VALUE
- is the generic type of the value
.public interface UiFeatureValueAndValidation<VALUE> extends UiFeatureValue<VALUE>, UiFeatureValidation<VALUE>
UiFeatureValue
and UiFeatureValidation
.Modifier and Type | Method and Description |
---|---|
VALUE |
getValueAndValidate(ValidationState state)
This method is a combination of
AttributeReadValueAdvanced.getValue() and AbstractValidatableObject.validate(ValidationState) . |
VALUE |
getValueDirect(VALUE template,
ValidationState state)
This method is a combination of
AttributeReadValueAdvanced.getValueOrException(Object) and
AbstractValidatableObject.validate(ValidationState) . |
addChangeHandler, removeChangeHandler
resetValue, setValue, setValue, setValueForUser
getOriginalValue, getValue, getValueOrException
addValidatorMandatory, isMandatory
addValidator, removeValidator
validate
VALUE getValueAndValidate(ValidationState state)
AttributeReadValueAdvanced.getValue()
and AbstractValidatableObject.validate(ValidationState)
. It is
designed for API users implementing higher level dialog logic and is therefore easy to use. It performs a
validation
and only on success it returns the value
. null
is not a valid value. Never call this method with
null
as argument if <VALUE> is Void
or anything else that considers
null
as a valid value. It should be used for high-level UI nodes such as entire input forms
or (sub-)dialogs.state
- is the ValidationState
. Shall initially be created as new instance and passed on in
case of recursive validations. May also be null
and will then be created internally
(in case you do not need the validation result).value
or null
if the
validation
failed or null
is the actual (valid)
value.VALUE getValueDirect(VALUE template, ValidationState state) throws RuntimeException
AttributeReadValueAdvanced.getValueOrException(Object)
and
AbstractValidatableObject.validate(ValidationState)
. It allows more efficient implementations as determining and creating
the value
can be expensive. Saving changes requires validation AND
on success getting the value, while already validation requires getting the value. For composite UI
objects this effect would reinforce to multiply the number of calls to
AttributeReadValueAdvanced.getValueOrException(Object)
. getValueAndValidate(ValidationState)
.template
- is the object where the data is filled in. May also be null
- then this
method will create a new instance.state
- is the ValidationState
. If null
the validation will be omitted,
otherwise an implicit validation is performed.current value
. May be null
(esp. if invalid).RuntimeException
- if state
is null
no validation is performed and input
errors are directly thrown causing a fast fail. Otherwise if validation is performed all
RuntimeException
are catched and according validation failures are
collected
and
visualized by the UI.Copyright © 2001–2016 mmm-Team. All rights reserved.