public interface ValidationContext
Modifier and Type | Method and Description |
---|---|
BindContext |
getBindContext() |
java.lang.String |
getCommand()
get the command that trigger the validation
|
java.util.Map<java.lang.String,Property[]> |
getProperties()
get dependent properties that need to be validated.
|
java.util.Map<java.lang.String,Property> |
getProperties(java.lang.Object base)
get dependent properties by a base object.
|
Property[] |
getProperties(java.lang.String name)
get dependent properties by the property name.
|
Property |
getProperty()
get the main property that need to be validated.
|
java.lang.Object |
getValidatorArg(java.lang.String key)
Returns validator arg value of the given key
This is a shortcut of
getBindContext().getValidatorArg() |
boolean |
isLocalValid()
Checks status of local validation context valid or not, it only relates to one validator.
|
boolean |
isValid()
Checks status of validation context valid or not, it is a global status of same command,
any validator of this validation phase call
setInvalid() will set this false. |
void |
setInvalid()
set invalid
|
boolean isValid()
setInvalid()
will set this false.Validator
called setInvalid()
. Note, default is true.boolean isLocalValid()
Validator
called setInvalid()
, default is true.void setInvalid()
java.lang.String getCommand()
java.util.Map<java.lang.String,Property[]> getProperties()
Property[] getProperties(java.lang.String name)
name
- the property namejava.util.Map<java.lang.String,Property> getProperties(java.lang.Object base)
Map beanProps = ctx.getProperties(ctx.getProperty().getBase());
Map formProps = ctx.getProperties(ctx.getProperty().getValue());
Notice that if the property is under a collection, you would see "$each", which represents "each"base
- the base object of propertiesjava.lang.Object getValidatorArg(java.lang.String key)
getBindContext().getValidatorArg()
key
- the key to the value.Property getProperty()
BindContext getBindContext()
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.