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