public class StringLengthValidator extends ModelTypeValidator implements MinMaxValidator
| Modifier and Type | Field and Description |
|---|---|
protected int |
max |
protected int |
min |
BIGDECIMAL_MAX, BIGDECIMAL_MIN, BIGINTEGER_MAX, BIGINTEGER_MIN, nullable, strictType, validTypes| Constructor and Description |
|---|
StringLengthValidator(int min)
Equivalent to
this(min, Integer.MAX_VALUE, false, false). |
StringLengthValidator(int min,
boolean nullable)
Equivalent to
this(min, Integer.MAX_VALUE, nullable, false). |
StringLengthValidator(int min,
boolean nullable,
boolean allowExpressions)
Equivalent to
this(min, Integer.MAX_VALUE, nullable, allowExpressions). |
StringLengthValidator(int min,
int max) |
StringLengthValidator(int min,
int max,
boolean nullable,
boolean allowExpressions)
Creates a new
StringLengthValidator. |
| Modifier and Type | Method and Description |
|---|---|
Long |
getMax()
Gets the maximum, if there is one.
|
Long |
getMin()
Gets the minimum, if there is one.
|
void |
validateParameter(String parameterName,
org.jboss.dmr.ModelNode value)
Validate the parameter with the given name.
|
validateResolvedParameterpublic StringLengthValidator(int min)
this(min, Integer.MAX_VALUE, false, false).min - the minimum length of the stringpublic StringLengthValidator(int min,
int max)
public StringLengthValidator(int min,
boolean nullable)
this(min, Integer.MAX_VALUE, nullable, false).min - the minimum length of the stringnullable - true is an ModelType.UNDEFINED value is validpublic StringLengthValidator(int min,
int max,
boolean nullable,
boolean allowExpressions)
StringLengthValidator.min - the minimum length of the stringmax - the maximum length of the stringnullable - true if an ModelType.UNDEFINED value is validallowExpressions - true if an ModelType.EXPRESSION value is validpublic StringLengthValidator(int min,
boolean nullable,
boolean allowExpressions)
this(min, Integer.MAX_VALUE, nullable, allowExpressions).min - the minimum length of the stringnullable - true if an ModelType.UNDEFINED value is validallowExpressions - true if an ModelType.EXPRESSION value is validpublic void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException
validateParameter in interface ParameterValidatorvalidateParameter in class ModelTypeValidatorparameterName - the name of the parameter. Cannot be nullvalue - the parameter value. Cannot be nullOperationFailedException - if the value is not validpublic Long getMin()
MinMaxValidatorgetMin in interface MinMaxValidatornull if there is no minimumpublic Long getMax()
MinMaxValidatorgetMax in interface MinMaxValidatornull if there is no minimumCopyright © 2017 JBoss by Red Hat. All rights reserved.