public abstract class RangeParserValidator<T extends Comparable<T>> extends BaseParserValidator<T>
Modifier and Type | Field and Description |
---|---|
static String |
LEFT_RANGE_DELIMITER |
protected static String |
RANGE_REGEXP |
static String |
RIGHT_RANGE_DELIMITER |
LEFT_PARAM_DELIMITER, model, PARAMETER_REGEXP, RIGHT_PARAM_DELIMITER, type, typeRegexp
Constructor and Description |
---|
RangeParserValidator(String model,
ModelType type)
Construct a range parser whose model definition should match the parser type or the type followed by range.
|
RangeParserValidator(String model,
ModelType type,
String typeRegexp)
Construct a range parser with a customized model definition rule.
|
Modifier and Type | Method and Description |
---|---|
protected Validator<T> |
createValidator(String model,
Converter<T> converter)
Create a validator used by this parser, using eventually a converter
|
protected com.google.common.collect.Range<T> |
extractRange(String value,
Converter<T> converter) |
protected static String |
typeRegexpWithOrWithoutRange(String type)
Get the regexp which matches the parser type (case insensitive) or the type followed by range.
|
createConverter, getClassType, ignoreCaseQuotedRegexp, ignoreCaseRegexp, parseAndGetOneGroup, parseAndGetRegexGroups, parseAndValidate, parseAndValidate
public static final String LEFT_RANGE_DELIMITER
public static final String RIGHT_RANGE_DELIMITER
protected static final String RANGE_REGEXP
public RangeParserValidator(String model, ModelType type) throws ModelSyntaxException
model
- the model definitiontype
- the parser typeModelSyntaxException
public RangeParserValidator(String model, ModelType type, String typeRegexp) throws ModelSyntaxException
model
- the model definitiontype
- the parser typetypeRegexp
- the expected pattern of the model expressionModelSyntaxException
protected static String typeRegexpWithOrWithoutRange(String type)
type
- the parser typeprotected Validator<T> createValidator(String model, Converter<T> converter) throws ModelSyntaxException
BaseParserValidator
createValidator
in class BaseParserValidator<T extends Comparable<T>>
model
- model used to create the validatorconverter
- converter eventually used to create the validatorModelSyntaxException
protected com.google.common.collect.Range<T> extractRange(String value, Converter<T> converter) throws ModelSyntaxException
ModelSyntaxException