Package | Description |
---|---|
org.foxlabs.validation | |
org.foxlabs.validation.constraint | |
org.foxlabs.validation.converter | |
org.foxlabs.validation.message |
Modifier and Type | Class and Description |
---|---|
protected class |
Validator.Context
This context holds current validation state.
|
Modifier and Type | Field and Description |
---|---|
protected ValidationContext<?> |
Validator.Context.parent
Parent context in case of cascade validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
Validation.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Determines if error message template returned by the method
Validation.getMessageTemplate(ValidationContext) needs to be rendered and
appends arguments to be substituted into the error message template. |
boolean |
AbstractValidation.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
context argument that contains current validation
context. |
String |
Validation.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
AbstractValidation.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template using class name as message key.
|
Validator.ContextBuilder |
Validator.newContext(ValidationContext<?> parent)
Creates a new context builder for cascade validation.
|
Constructor and Description |
---|
ContextBuilder(ValidationContext<?> parent)
Constructs a new
ContextBuilder for cascade validation. |
ViolationException(Validation<?> component,
ValidationContext<?> context,
Object value)
Constructs a new
ViolationException with the specified
validation component, context and invalid value. |
ViolationException(Validation<?> component,
ValidationContext<?> context,
Object value,
Throwable cause)
Constructs a new
ViolationException with the specified
validation component, context, invalid value and cause. |
Modifier and Type | Method and Description |
---|---|
boolean |
SizeConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
minSize and maxSize arguments that
contain minimum and maximum allowed size respectively. |
boolean |
CustomConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
The default behavior of this method is to return
Constraint.appendMessageArguments(ValidationContext, Map) on the
composite constraint. |
boolean |
UriAddressConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
schemes argument that contains set of allowed
schemes. |
boolean |
ConstraintComposition.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Returns
false . |
boolean |
FileSizeConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
minSize and maxSize arguments that
contain minimum and maximum allowed file size respectively. |
boolean |
EnumerationConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constants argument that contains set of allowed
constants. |
boolean |
IdentityConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Returns
false . |
boolean |
InstanceOfConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
types argument that contains array of allowed types. |
boolean |
ImageSizeConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
maxWidth and maxHeight arguments that
contain maximum allowed image width and height respectively. |
boolean |
SequenceElementConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constraint argument that contains constraint of
sequence elements. |
boolean |
RangeConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
min and max arguments that contain
minimum and maximum value respectively. |
boolean |
Constraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends arguments to be substituted into the error message template.
|
boolean |
IllegalCharsetConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
charset argument that contains disallowed character
set. |
boolean |
PropertyComparisonConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
property argument that contains property name of
the second operand. |
boolean |
LegalCharsetConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
charset argument that contains allowed character
set. |
boolean |
ConstraintAggregation.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constraints argument that contains encapsulated
constraints. |
boolean |
ConstraintWrapper.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
The default behavior of this method is to return
Constraint.appendMessageArguments(ValidationContext, Map) on the
wrapped constraint. |
boolean |
RegexConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
pattern argument that contains regular expression
pattern. |
boolean |
UrlAddressConstraint.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
protocols argument that contains set of allowed
protocols. |
protected <T> boolean |
IsTrueConstraint.check(Boolean value,
ValidationContext<T> context)
Checks whether the specified boolean value is
true . |
protected <T> boolean |
IsFalseConstraint.check(Boolean value,
ValidationContext<T> context)
Checks whether the specified boolean value is
false . |
protected <T> boolean |
FutureDateConstraint.check(Date value,
ValidationContext<T> context)
Checks whether the specified date is a date in the future.
|
protected <T> boolean |
PastDateConstraint.check(Date value,
ValidationContext<T> context)
Checks whether the specified date is a date in the past.
|
protected <T> boolean |
FileSizeConstraint.check(File value,
ValidationContext<T> context)
Checks whether size of the specified file is within allowed minimum and
maximum bounds.
|
protected <T> boolean |
FileExistsConstraint.check(File file,
ValidationContext<T> context)
Checks existence of the specified file or directory.
|
protected <T> boolean |
InstanceOfConstraint.check(Object value,
ValidationContext<T> context)
Checks whether the specified value is instance of one of allowed types.
|
protected <T> boolean |
NotNullConstraint.check(Object value,
ValidationContext<T> context)
Checks whether the specified value is not
null . |
protected <T> boolean |
IsNullConstraint.check(Object value,
ValidationContext<T> context)
Checks whether the specified value is
null . |
protected <T> boolean |
Ip6AddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid IPv6 address.
|
protected <T> boolean |
UriAddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid URI reference with allowed
scheme.
|
protected <T> boolean |
EmailAddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid email address.
|
protected <T> boolean |
NotBlankConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is not
null or empty. |
protected <T> boolean |
IpAddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid IPv4 or IPv6 address.
|
protected <T> boolean |
HostnameConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid internet hostname.
|
protected <T> boolean |
IllegalCharsetConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string not contains disallowed characters.
|
protected <T> boolean |
LegalCharsetConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string contains allowed characters only.
|
protected <T> boolean |
Ip4AddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid IPv4 address.
|
protected <T> boolean |
InetAddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid internet address.
|
protected <T> boolean |
IdentifierConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid identifier.
|
protected <T> boolean |
RegexConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string matches the regular expression.
|
protected <T> boolean |
UrlAddressConstraint.check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid URL reference with allowed
prefix and protocol.
|
protected <T> boolean |
SizeConstraint.check(V value,
ValidationContext<T> context)
Checks whether the size of the specified value is within allowed
minimum and maximum bounds.
|
protected <T> boolean |
EnumerationConstraint.check(V value,
ValidationContext<T> context)
Checks whether the specified value is one of the allowed constants.
|
protected <T> boolean |
NotEmptyConstraint.check(V value,
ValidationContext<T> context)
Checks whether the specified value is not empty.
|
protected <T> boolean |
RangeConstraint.check(V value,
ValidationContext<T> context)
Checks whether the specified value is within allowed minimum and maximum
range.
|
protected <T> boolean |
PropertyComparisonConstraint.check(V value1,
ValidationContext<T> context)
Applies binary comparison operator to the specified value and other
property.
|
protected abstract <T> boolean |
CheckConstraint.check(V value,
ValidationContext<T> context)
Checks whether the specified value conforms this constraint rules.
|
protected <T> Collection<V> |
CollectionElementConstraint.doValidate(Collection<V> collection,
ValidationContext<T> context,
List<ConstraintViolationException> violations)
Checks whether all elements of the specified collection conforms to the
constraint of collection elements.
|
protected <T> Map<Object,V> |
MapValueConstraint.doValidate(Map<Object,V> map,
ValidationContext<T> context,
List<ConstraintViolationException> violations)
Checks whether all values of the specified map conforms to the constraint
of map values.
|
protected <T> Map<V,Object> |
MapKeyConstraint.doValidate(Map<V,Object> map,
ValidationContext<T> context,
List<ConstraintViolationException> violations)
Checks whether all keys of the specified map conforms to the constraint
of map keys.
|
protected <T> Object |
ArrayElementConstraint.doValidate(Object array,
ValidationContext<T> context,
List<ConstraintViolationException> violations)
Checks whether all elements of the specified array conforms to the
constraint of array elements.
|
protected abstract <T> V |
SequenceElementConstraint.doValidate(V sequence,
ValidationContext<T> context,
List<ConstraintViolationException> violations)
Checks whether all elements of the specified sequence conforms to the
constraint of sequence elements.
|
String |
SizeConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
CorrectConstraint.getMessageTemplate(ValidationContext<?> context)
CorrectConstraint s have no error message. |
String |
CustomConstraint.getMessageTemplate(ValidationContext<?> context)
The default behavior of this method is to return
Constraint.getMessageTemplate(ValidationContext) on the
composite constraint. |
String |
ConstraintComposition.getMessageTemplate(ValidationContext<?> context)
Returns localized error message or
null if all of the
encapsulated constraints have no error message. |
String |
FileSizeConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
IdentityConstraint.getMessageTemplate(ValidationContext<?> context)
Returns
null . |
String |
NotEmptyConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
ImageSizeConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
ConstraintMessageWrapper.getMessageTemplate(ValidationContext<?> context)
Returns wrapped error message template.
|
String |
FileExistsConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
ConstraintGroupWrapper.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template of the wrapped constraint or
null if no group of this wrapper matches groups provided by
validation context. |
String |
RangeConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
Constraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
PropertyComparisonConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
LogLevelConstraint.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
ConstraintWrapper.getMessageTemplate(ValidationContext<?> context)
The default behavior of this method is to return
Constraint.getMessageTemplate(ValidationContext) on the wrapped
constraint. |
String |
CascadeConstraint.getMessageTemplate(ValidationContext<?> context)
CascadeConstaint has no error message. |
protected <T> int |
SizeConstraint.CollectionType.getSize(Collection<?> value,
ValidationContext<T> context)
Returns size of the specified collection.
|
protected <T> int |
SizeConstraint.MapType.getSize(Map<?,?> value,
ValidationContext<T> context)
Returns size of the specified map.
|
protected <T> int |
SizeConstraint.ArrayType.getSize(Object value,
ValidationContext<T> context)
Returns length of the specified array.
|
protected <T> int |
SizeConstraint.StringType.getSize(String value,
ValidationContext<T> context)
Returns length of the specified string.
|
protected abstract <T> int |
SizeConstraint.getSize(V value,
ValidationContext<T> context)
Returns size of the specified value.
|
protected <T> boolean |
NotEmptyConstraint.CollectionType.isEmpty(Collection<?> value,
ValidationContext<T> context)
Determines whether the specified collection is empty.
|
protected <T> boolean |
NotEmptyConstraint.MapType.isEmpty(Map<?,?> value,
ValidationContext<T> context)
Determines whether the specified map is empty.
|
protected <T> boolean |
NotEmptyConstraint.ArrayType.isEmpty(Object value,
ValidationContext<T> context)
Determines whether the specified array is empty.
|
protected <T> boolean |
NotEmptyConstraint.StringType.isEmpty(String value,
ValidationContext<T> context)
Determines whether the specified string is empty.
|
protected abstract <T> boolean |
NotEmptyConstraint.isEmpty(V value,
ValidationContext<T> context)
Determines whether the specified value is empty.
|
<T> Collection<?> |
RemoveNullElementsConstraint.CollectionType.validate(Collection<?> collection,
ValidationContext<T> context)
Removes all
null elements from the specified collection. |
<T> Date |
SysdateConstraint.validate(Date value,
ValidationContext<T> context)
Returns current system date if the specified date is
null ;
returns date as is otherwise. |
<T> Object[] |
RemoveNullElementsConstraint.ArrayType.validate(Object[] array,
ValidationContext<T> context)
Removes all
null elements from the specified array. |
<T> Object |
IdentityConstraint.validate(Object value,
ValidationContext<T> context)
Returns the specified value.
|
<T> Object |
SetNullConstraint.validate(Object value,
ValidationContext<T> context)
Returns
null . |
<T> String |
UpperCaseConstraint.validate(String value,
ValidationContext<T> context)
Converts the specified string to upper case.
|
<T> String |
LowerCaseConstraint.validate(String value,
ValidationContext<T> context)
Converts the specified string to lower case.
|
<T> String |
TrimConstraint.validate(String value,
ValidationContext<T> context)
Returns the specified string with no leading and trailing whitespaces.
|
<T> String |
DespaceConstraint.validate(String value,
ValidationContext<T> context)
Removes all whitespaces from the specified string.
|
<T> String |
CapitalizeAllConstraint.validate(String value,
ValidationContext<T> context)
Converts to upper case first letters of all words in the specified
string.
|
<T> String |
NullifyConstraint.validate(String value,
ValidationContext<T> context)
Returns
null if the specified string is empty; returns
string as is otherwise. |
<T> String |
CoalesceConstraint.validate(String value,
ValidationContext<T> context)
Replaces all whitespaces with replacement character in the specified
string.
|
<T> String |
ReplaceConstraint.validate(String value,
ValidationContext<T> context)
Replaces each substring of the specified string that matches the given
regular expression with the given replacement.
|
<T> String |
MaxLengthConstraint.validate(String value,
ValidationContext<T> context)
Returns substring of maximum length for the specified string or string
as is if its length is not greater than maximum length.
|
<T> String |
CapitalizeConstraint.validate(String value,
ValidationContext<T> context)
Converts to upper case first letter of first word in the specified
string.
|
<T> V |
CustomConstraint.validate(V value,
ValidationContext<T> context)
The default behavior of this method is to return
Constraint.validate(Object, ValidationContext) on the composite
constraint. |
<T> V |
ConstraintNegation.validate(V value,
ValidationContext<T> context)
Checks whether the specified value not conforms to all of the
encapsulated constraints.
|
<T> V |
ImageSizeConstraint.validate(V value,
ValidationContext<T> context)
Checks whether the size of the specified image is within maximum bounds.
|
<T> V |
SequenceElementConstraint.validate(V sequence,
ValidationContext<T> context)
Checks whether all elements of the specified sequence conforms to the
constraint of sequence elements.
|
<T> V |
ConstraintGroupWrapper.validate(V value,
ValidationContext<T> context)
Validates the specified value using context if needed and returns
possibly modified value.
|
<T> V |
Constraint.validate(V value,
ValidationContext<T> context)
Validates the specified value using context if needed and returns
possibly modified value.
|
<T> V |
CheckConstraint.validate(V value,
ValidationContext<T> context)
Performs validation of the specified value and returns unmodified value.
|
<T> V |
DefaultValueConstraint.validate(V value,
ValidationContext<T> context)
Returns default value if the specified value is
null ;
returns value as is otherwise. |
<T> V |
ConstraintDisjunction.validate(V value,
ValidationContext<T> context)
Checks whether the specified value conforms at least one of the
encapsulated constraints.
|
<T> V |
ConstraintAggregation.validate(V value,
ValidationContext<T> context)
Checks whether the specified value conforms to all of the encapsulated
constraints.
|
<T> V |
ConstraintWrapper.validate(V value,
ValidationContext<T> context)
The default behavior of this method is to return
Constraint.validate(Object, ValidationContext) on the wrapped
constraint. |
<T> V |
CascadeConstraint.validate(V value,
ValidationContext<T> context)
Performs cascade validation on the specified entity.
|
Constructor and Description |
---|
ConstraintViolationException(Constraint<?> constraint,
ValidationContext<?> context,
Object value)
Constructs a new
ConstraintViolationException with the
specified constraint, context and invalid value. |
ConstraintViolationException(Constraint<?> constraint,
ValidationContext<?> context,
Object value,
Throwable cause)
Constructs a new
ConstraintViolationException with the
specified constraint, context, invalid value and cause. |
Modifier and Type | Method and Description |
---|---|
boolean |
UnsupportedConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
type argument that contains unsupported type. |
boolean |
CollectionConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
converter argument that contains converter of
collection elements. |
boolean |
ConverterWrapper.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
The default behavior of this method is to return
Converter.appendMessageArguments(ValidationContext, Map) on the
wrapped converter. |
boolean |
NumberConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
In case of localized conversion appends
pattern argument
that contains localized number pattern. |
boolean |
LogLevelConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
levels argument that contains set of known log
levels. |
boolean |
EnumConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constants argument that contains set of allowed
enumeration constants. |
boolean |
SimpleTokenizer.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
delims argument that contains allowed elements
delimiter characters. |
boolean |
BooleanConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
constants argument that contains set of allowed
boolean constants. |
boolean |
MapConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
kconverter and vconverter arguments
that contain converter of map keys and converter of map values
respectively. |
boolean |
Converter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends arguments to be substituted into the error message template.
|
boolean |
DateConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
In case of localized conversion appends
pattern argument
that contains localized date/time pattern. |
boolean |
ArrayConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
converter argument that contains converter of array
elements. |
boolean |
CustomConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
The default behavior of this method is to return
Converter.appendMessageArguments(ValidationContext, Map) on the
composite converter. |
boolean |
SequenceConverter.appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
tokenizer argument that contains tokenizer of
elements sequence. |
<T> V |
UnsupportedConverter.decode(String value,
ValidationContext<T> context)
Throws
MalformedValueException . |
<T> String[] |
Tokenizer.decode(String value,
ValidationContext<T> context)
Returns array of tokens extracted from the source string.
|
<T> String |
StringConverter.decode(String value,
ValidationContext<T> context)
Returns value as is.
|
<T> V |
ConverterWrapper.decode(String value,
ValidationContext<T> context)
The default behavior of this method is to return
Converter.decode(String, ValidationContext) on the wrapped
converter. |
<T> V |
Converter.decode(String value,
ValidationContext<T> context)
Converts string representation of value into object.
|
<T> V |
CustomConverter.decode(String value,
ValidationContext<T> context)
The default behavior of this method is to return
Converter.decode(String, ValidationContext) on the composite
converter. |
<T> V |
AbstractConverter.decode(String value,
ValidationContext<T> context)
Converts string representation of value into object.
|
<T> V |
SequenceConverter.decode(String value,
ValidationContext<T> context)
Converts string representation of elements sequence into object.
|
protected <T> Collection<V> |
CollectionConverter.doDecode(String[] tokens,
ValidationContext<T> context,
List<MalformedValueException> violations)
Converts string representations of collection elements into collection.
|
protected <T> Map<K,V> |
MapConverter.doDecode(String[] tokens,
ValidationContext<T> context,
List<MalformedValueException> violations)
Converts string representations of key-value pairs into map.
|
protected <T> Object |
ArrayConverter.doDecode(String[] tokens,
ValidationContext<T> context,
List<MalformedValueException> violations)
Converts string representations of array elements into array.
|
protected abstract <T> V |
SequenceConverter.doDecode(String[] tokens,
ValidationContext<T> context,
List<MalformedValueException> violations)
Converts string representations of elements into elements sequence.
|
protected <T> URL |
URLConverter.doDecode(String value,
ValidationContext<T> context)
Converts URL string into
java.net.URL object. |
protected <T> Class<?> |
ClassConverter.doDecode(String value,
ValidationContext<T> context)
Returns
java.lang.Class object for the specified class name. |
protected <T> Locale |
LocaleConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of locale into
java.util.Locale object. |
protected <T> V |
NumberConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of numeric value into
java.lang.Number object. |
protected <T> File |
FileConverter.doDecode(String value,
ValidationContext<T> context)
Returns
java.io.File object for the specified path. |
protected <T> URI |
URIConverter.doDecode(String value,
ValidationContext<T> context)
Converts URI string into
java.net.URI object. |
protected <T> Character |
CharacterConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of character value into
java.lang.Character object. |
protected <T> Level |
LogLevelConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of log level into
java.util.logging.Level object. |
protected <T> V |
EnumConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of enumeration value into
java.lang.Enum object. |
protected <T> String[] |
SimpleTokenizer.doDecode(String value,
ValidationContext<T> context)
Returns array of tokens extracted from the source string.
|
protected <T> Boolean |
BooleanConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of boolean value into
java.lang.Boolean object. |
protected <T> TimeZone |
TimeZoneConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of time zone into
java.util.TimeZone object. |
protected <T> Date |
DateConverter.doDecode(String value,
ValidationContext<T> context)
Converts string representation of date/time into
java.util.Date object. |
protected <T> V |
AbstractConverter.doDecode(String value,
ValidationContext<T> context)
Converts non-empty string representation of value into object.
|
protected <T> String |
BooleanConverter.doEncode(Boolean value,
ValidationContext<T> context)
Converts
java.lang.Boolean object into string
representation. |
protected <T> String |
ClassConverter.doEncode(Class<?> value,
ValidationContext<T> context)
Returns class name for the specified
java.lang.Class object. |
protected <T> String |
DateConverter.doEncode(Date value,
ValidationContext<T> context)
Converts
java.util.Date object into string representation. |
protected <T> String |
FileConverter.doEncode(File value,
ValidationContext<T> context)
Returns pathname for the specified
java.io.File object. |
protected <T> String |
LogLevelConverter.doEncode(Level value,
ValidationContext<T> context)
Converts
java.util.logging.Level object into string
representation. |
protected <T> String |
LocaleConverter.doEncode(Locale value,
ValidationContext<T> context)
Converts
java.util.Locale object into string representation. |
protected <T> String |
SimpleTokenizer.doEncode(String[] value,
ValidationContext<T> context)
Builds string from the specified array of tokens.
|
protected <T> String |
TimeZoneConverter.doEncode(TimeZone value,
ValidationContext<T> context)
Converts
java.util.TimeZone object into string
representation. |
protected <T> String |
NumberConverter.doEncode(V value,
ValidationContext<T> context)
Converts
java.lang.Number object into string representation. |
protected <T> String |
EnumConverter.doEncode(V value,
ValidationContext<T> context)
Converts
java.lang.Enum object into string representation. |
protected <T> String |
AbstractConverter.doEncode(V value,
ValidationContext<T> context)
Converts null-safe value into string representation.
|
<T> String |
CollectionConverter.encode(Collection<V> value,
ValidationContext<T> context)
Converts collection into string representation of collection elements.
|
<T> String |
MapConverter.encode(Map<K,V> value,
ValidationContext<T> context)
Converts map into string representation of key-value pairs.
|
<T> String |
ArrayConverter.encode(Object value,
ValidationContext<T> context)
Converts array into string representation of array elements.
|
<T> String |
Tokenizer.encode(String[] value,
ValidationContext<T> context)
Builds string from the specified array of tokens.
|
<T> String |
StringConverter.encode(String value,
ValidationContext<T> context)
Returns empty string if value is
null ; value as is otherwise. |
<T> String |
UnsupportedConverter.encode(V value,
ValidationContext<T> context)
Returns
value.toString() if value is not null ;
returns empty string otherwise. |
<T> String |
ConverterWrapper.encode(V value,
ValidationContext<T> context)
The default behavior of this method is to return
Converter.encode(Object, ValidationContext) on the wrapped
converter. |
<T> String |
Converter.encode(V value,
ValidationContext<T> context)
Converts value into string representation.
|
<T> String |
CustomConverter.encode(V value,
ValidationContext<T> context)
The default behavior of this method is to return
Converter.encode(Object, ValidationContext) on the composite
converter. |
<T> String |
AbstractConverter.encode(V value,
ValidationContext<T> context)
Converts value into string representation.
|
protected abstract NumberFormat |
NumberConverter.getFormat(ValidationContext<?> context)
Returns number format for the specified context and this converter
configuration.
|
protected NumberFormat |
NumberConverter.IntegerType.getFormat(ValidationContext<?> context)
Returns integer number format for the specified context and this
converter configuration.
|
protected NumberFormat |
NumberConverter.DecimalType.getFormat(ValidationContext<?> context)
Returns decimal number format for the specified context and this
converter configuration.
|
protected NumberFormat |
BigDecimalConverter.getFormat(ValidationContext<?> context)
Returns decimal number format for the specified context and this
converter configuration.
|
protected DateFormat |
DateConverter.getFormat(ValidationContext<?> context)
Returns date/time format for the specified context and this converter
configuration.
|
String |
StringConverter.getMessageTemplate(ValidationContext<?> context)
StringConverter has no error message. |
String |
ConverterWrapper.getMessageTemplate(ValidationContext<?> context)
The default behavior of this method is to return
Converter.getMessageTemplate(ValidationContext) on the wrapped
converter. |
String |
FileConverter.getMessageTemplate(ValidationContext<?> context)
FileConverter has no error message template. |
String |
Converter.getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
String |
CustomConverter.getMessageTemplate(ValidationContext<?> context)
The default behavior of this method is to return
Converter.getMessageTemplate(ValidationContext) on the composite
converter. |
String |
ConverterMessageWrapper.getMessageTemplate(ValidationContext<?> context)
Returns wrapped error message template.
|
protected <T> String[] |
MapConverter.tokenize(String value,
ValidationContext<T> context)
Returns array of tokens extracted from the source string.
|
protected <T> String[] |
SequenceConverter.tokenize(String value,
ValidationContext<T> context)
Returns array of tokens extracted from the source string.
|
Constructor and Description |
---|
MalformedValueException(Converter<?> converter,
ValidationContext<?> context,
String value)
Constructs a new
MalformedValueException with the specified
converter, context and invalid value. |
MalformedValueException(Converter<?> converter,
ValidationContext<?> context,
String value,
Throwable cause)
Constructs a new
MalformedValueException with the specified
converter, context, invalid value and cause. |
Modifier and Type | Method and Description |
---|---|
String |
AbstractMessageBuilder.buildMessage(Validation<?> component,
ValidationContext<?> context)
Builds localized error message for the specified validation component
and context.
|
String |
MessageBuilder.buildMessage(Validation<?> component,
ValidationContext<?> context)
Builds localized error message for the specified validation component
and context.
|
protected String |
DefaultMessageBuilder.renderArgument(Object value,
ValidationContext<?> context)
Renders the specified message argument.
|
protected String |
DefaultMessageBuilder.renderComponents(Validation<?>[] components,
ValidationContext<?> context)
Renders the specified array of validation components.
|
protected String |
DefaultMessageBuilder.renderContext(ValidationContext<?> context)
Renders the specified validation context.
|
protected abstract String |
AbstractMessageBuilder.renderTemplate(String template,
Map<String,Object> arguments,
ValidationContext<?> context)
Renders the specified message template using the specified arguments.
|
protected String |
DefaultMessageBuilder.renderTemplate(String template,
Map<String,Object> arguments,
ValidationContext<?> context)
Renders the specified message template using the specified arguments.
|
protected String |
DefaultMessageBuilder.renderValue(Object value,
ValidationContext<?> context)
Renders the specified null-safe value.
|
Copyright © 2011–2020 FoxLabs. All rights reserved.