V
- The type of array elementspublic final class ArrayConverter<V> extends SequenceConverter<Object>
Converter
implementation for all
one-dimensional array types.Tokenizer
,
ConverterFactory.forArray(Converter)
,
ConverterFactory.forArray(Converter, String)
,
ConverterFactory.forArray(Converter, Tokenizer)
tokenizer
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
converter argument that contains converter of array
elements. |
protected <T> Object |
doDecode(String[] tokens,
ValidationContext<T> context,
List<MalformedValueException> violations)
Converts string representations of array elements into array.
|
<T> String |
encode(Object value,
ValidationContext<T> context)
Converts array into string representation of array elements.
|
Class<Object> |
getType()
Returns array type.
|
decode, tokenize
getMessageTemplate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTemplate
public boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
converter
argument that contains converter of array
elements.appendMessageArguments
in interface Converter<Object>
appendMessageArguments
in interface Validation<Object>
appendMessageArguments
in class SequenceConverter<Object>
context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
.protected <T> Object doDecode(String[] tokens, ValidationContext<T> context, List<MalformedValueException> violations)
doDecode
in class SequenceConverter<Object>
T
- The type of validated entity.tokens
- String representations of array elements.context
- Validation context.violations
- List of violations.MalformedValueException
- if conversion of array elements fails.public <T> String encode(Object value, ValidationContext<T> context)
T
- The type of validated entity.value
- Array to be encoded.context
- Validation context.Copyright © 2011–2020 FoxLabs. All rights reserved.