public static class Form.FieldVisitorValidatorWrapper extends Object implements FieldValidator
Constructor and Description |
---|
FieldVisitorValidatorWrapper(FieldValidator fv,
String namePrefix) |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultMessage()
Gets the default message used for validation failures
|
String |
getFieldName()
Gets the field name to be validated
|
FieldValidator |
getFieldValidator() |
String |
getMessage(Object object)
Gets the validation failure message for the given object
|
String |
getMessageKey()
Gets the resource bundle key used for lookup of validation failure message
|
String[] |
getMessageParameters()
Gets the message parameters to be used when parsing i18n messages
|
String |
getNamePrefix() |
ValidatorContext |
getValidatorContext()
Gets the validation context used
|
String |
getValidatorType()
Gets the validator type used (see class javadoc).
|
void |
setDefaultMessage(String message)
Sets the default message to use for validation failure
|
void |
setFieldName(String fieldName)
Sets the field name to validate with this FieldValidator
|
void |
setFieldValidator(FieldValidator fieldValidator) |
void |
setMessageKey(String key)
Sets a resource bundle key to be used for lookup of validation failure message
|
void |
setMessageParameters(String[] messageParameters)
Sets the message parameters to be used when parsing i18n messages
|
void |
setNamePrefix(String namePrefix) |
void |
setValidatorContext(ValidatorContext validatorContext)
This method will be called before validate with a non-null ValidatorContext.
|
void |
setValidatorType(String type)
Sets the validator type to use (see class javadoc).
|
void |
setValueStack(ValueStack stack)
Sets the value stack to use to resolve values and parameters
|
void |
validate(Object object)
The validation implementation must guarantee that setValidatorContext will
be called with a non-null ValidatorContext before validate is called.
|
public FieldVisitorValidatorWrapper(FieldValidator fv, String namePrefix)
public String getValidatorType()
Validator
getValidatorType
in interface Validator
public String getFieldName()
FieldValidator
getFieldName
in interface FieldValidator
public FieldValidator getFieldValidator()
public void setFieldValidator(FieldValidator fieldValidator)
public String getDefaultMessage()
Validator
getDefaultMessage
in interface Validator
public String getMessage(Object object)
Validator
getMessage
in interface Validator
object
- object being validated (eg. a domain model object)public String getMessageKey()
Validator
getMessageKey
in interface Validator
public String[] getMessageParameters()
Validator
getMessageParameters
in interface Validator
public ValidatorContext getValidatorContext()
Validator
getValidatorContext
in interface Validator
public void setDefaultMessage(String message)
Validator
setDefaultMessage
in interface Validator
message
- the default messagepublic void setFieldName(String fieldName)
FieldValidator
setFieldName
in interface FieldValidator
fieldName
- the field namepublic void setMessageKey(String key)
Validator
setMessageKey
in interface Validator
key
- the resource bundle keypublic void setMessageParameters(String[] messageParameters)
Validator
setMessageParameters
in interface Validator
messageParameters
- the message parameterspublic void setValidatorContext(ValidatorContext validatorContext)
Validator
setValidatorContext
in interface Validator
validatorContext
- the validation context to use.public void setValidatorType(String type)
Validator
setValidatorType
in interface Validator
type
- the type to use.public void setValueStack(ValueStack stack)
Validator
setValueStack
in interface Validator
stack
- The value stack for the requestpublic void validate(Object object) throws ValidationException
Validator
validate
in interface Validator
object
- the object to be validated.ValidationException
- is thrown if there is validation error(s).public String getNamePrefix()
public void setNamePrefix(String namePrefix)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.