public class BooleanValidator extends PatternValidator implements TypeValidator
resourceBundle| Constructor and Description |
|---|
BooleanValidator()
Creates a new BooleanValidator with no restrictions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearFixed()
Clears the fixed value for this BooleanValidator.
|
Boolean |
getFixed()
Returns the fixed value that booleans validated with this validator must be equal to.
|
boolean |
hasFixed()
Returns true if a fixed value to validate against has been set.
|
void |
setFixed(boolean fixedValue)
Sets the fixed value for boolean validation.
|
void |
setFixed(Boolean fixedValue)
Sets the fixed value for boolean validation.
|
void |
validate(boolean b,
ValidationContext context)
Validates the given Object.
|
void |
validate(Object object)
Validates the given Object.
|
void |
validate(Object object,
ValidationContext context)
Validates the given Object.
|
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillable, validatepublic BooleanValidator()
public void clearFixed()
public Boolean getFixed()
public boolean hasFixed()
public void setFixed(boolean fixedValue)
fixedValue - the fixed value that a boolean validated with this validator must be equal
to.public void setFixed(Boolean fixedValue)
fixedValue - the fixed value that a boolean validated with this validator must be equal
to.public void validate(boolean b,
ValidationContext context)
throws ValidationException
b - the boolean to validatecontext - the ValidationContextValidationException - if the object fails validation.public void validate(Object object) throws ValidationException
object - the Object to validateValidationException - if the object fails validation.public void validate(Object object, ValidationContext context) throws ValidationException
validate in interface TypeValidatorvalidate in class PatternValidatorobject - the Object to validatecontext - the ValidationContextValidationException - if the object fails validation.Copyright © 2016. All rights reserved.