public final class SimpleTokenizer extends Tokenizer
Tokenizer
implementation based on
delimiter characters like java.util.StringTokenizer
.Modifier and Type | Field and Description |
---|---|
static SimpleTokenizer |
DEFAULT
SimpleTokenizer default instance initialized with
,;| \t\n\r elements delimiters. |
EMPTY_TOKEN_ARRAY
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
delims argument that contains allowed elements
delimiter characters. |
protected <T> String[] |
doDecode(String value,
ValidationContext<T> context)
Returns array of tokens extracted from the source string.
|
protected <T> String |
doEncode(String[] value,
ValidationContext<T> context)
Builds string from the specified array of tokens.
|
getMessageTemplate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTemplate
public static final SimpleTokenizer DEFAULT
SimpleTokenizer
default instance initialized with
,;| \t\n\r
elements delimiters.public boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
delims
argument that contains allowed elements
delimiter characters.appendMessageArguments
in interface Converter<String[]>
appendMessageArguments
in interface Validation<String[]>
appendMessageArguments
in class AbstractValidation<String[]>
context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
.protected <T> String[] doDecode(String value, ValidationContext<T> context)
doDecode
in class AbstractConverter<String[]>
T
- The type of validated entity.value
- Source string to be tokenized.context
- Validation context.protected <T> String doEncode(String[] value, ValidationContext<T> context)
doEncode
in class AbstractConverter<String[]>
T
- The type of validated entity.value
- Array of tokens.context
- Validation context.Copyright © 2011–2020 FoxLabs. All rights reserved.