public interface ValidationContext
| Modifier and Type | Method and Description |
|---|---|
BindContext |
getBindContext() |
String |
getCommand()
get the command that trigger the validation
|
Map<String,Property[]> |
getProperties()
get dependent properties that need to be validated.
|
Map<String,Property> |
getProperties(Object base)
get dependent properties by a base object.
|
Property[] |
getProperties(String name)
get dependent properties by the property name.
|
Property |
getProperty()
get the main property that need to be validated.
|
Object |
getValidatorArg(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()
String getCommand()
Map<String,Property[]> getProperties()
Property[] getProperties(String name)
name - the property nameMap<String,Property> getProperties(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 propertiesObject getValidatorArg(String key)
getBindContext().getValidatorArg()key - the key to the value.Property getProperty()
BindContext getBindContext()
Copyright © 2020. All rights reserved.