public class ValidationContextImpl extends Object implements ValidationContext
Constructor and Description |
---|
ValidationContextImpl(String command,
Property property,
Map<String,Property[]> properties,
BindContext ctx,
boolean valid) |
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
ValidationContext.setInvalid() will set this false. |
void |
setInvalid()
set invalid
|
public BindContext getBindContext()
getBindContext
in interface ValidationContext
public String getCommand()
ValidationContext
getCommand
in interface ValidationContext
public Map<String,Property[]> getProperties()
ValidationContext
getProperties
in interface ValidationContext
public Property[] getProperties(String name)
ValidationContext
getProperties
in interface ValidationContext
name
- the property namepublic Map<String,Property> getProperties(Object base)
ValidationContext
Map beanProps = ctx.getProperties(ctx.getProperty().getBase());
Map formProps = ctx.getProperties(ctx.getProperty().getValue());
getProperties
in interface ValidationContext
base
- the base object of propertiespublic Object getValidatorArg(String key)
ValidationContext
getBindContext().getValidatorArg()
getValidatorArg
in interface ValidationContext
key
- the key to the value.public Property getProperty()
ValidationContext
getProperty
in interface ValidationContext
public boolean isValid()
ValidationContext
ValidationContext.setInvalid()
will set this false.isValid
in interface ValidationContext
Validator
called ValidationContext.setInvalid()
. Note, default is true.public boolean isLocalValid()
ValidationContext
isLocalValid
in interface ValidationContext
Validator
called ValidationContext.setInvalid()
, default is true.public void setInvalid()
ValidationContext
setInvalid
in interface ValidationContext
Copyright © 2016. All rights reserved.