Class ListValidator
java.lang.Object
org.jboss.as.controller.operations.validation.ModelTypeValidator
org.jboss.as.controller.operations.validation.ListValidator
- All Implemented Interfaces:
MinMaxValidator,ParameterValidator
public class ListValidator
extends ModelTypeValidator
implements ParameterValidator, MinMaxValidator
Validates parameters of type
ModelType.LIST.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Field Summary
Fields inherited from class org.jboss.as.controller.operations.validation.ModelTypeValidator
BIGDECIMAL_MAX, BIGDECIMAL_MIN, BIGINTEGER_MAX, BIGINTEGER_MIN, nullable, strictType, validTypes -
Constructor Summary
ConstructorsConstructorDescriptionListValidator(ParameterValidator elementValidator) Constructs a newListValidatorListValidator(ParameterValidator elementValidator, boolean nullable) ListValidator(ParameterValidator elementValidator, boolean nullable, boolean allowDuplicates) ListValidator(ParameterValidator elementValidator, boolean nullable, int minSize, int maxSize) ListValidator(ParameterValidator elementValidator, boolean nullable, int minSize, int maxSize, boolean allowDuplicates) -
Method Summary
-
Constructor Details
-
ListValidator
Constructs a newListValidator- Parameters:
elementValidator- validator for list elements
-
ListValidator
- Parameters:
elementValidator- validator for list elementsnullable-trueif the model node for the list can benullorModelType.UNDEFINED
-
ListValidator
public ListValidator(ParameterValidator elementValidator, boolean nullable, boolean allowDuplicates) - Parameters:
elementValidator- validator for list elementsnullable-trueif the model node for the list can benullorModelType.UNDEFINED
-
ListValidator
public ListValidator(ParameterValidator elementValidator, boolean nullable, int minSize, int maxSize) - Parameters:
elementValidator- validator for list elementsnullable-trueif the model node for the list can benullorModelType.UNDEFINEDminSize- minimum number of elements in the listmaxSize- maximum number of elements in the list
-
ListValidator
public ListValidator(ParameterValidator elementValidator, boolean nullable, int minSize, int maxSize, boolean allowDuplicates) - Parameters:
elementValidator- validator for list elementsnullable-trueif the model node for the list can benullorModelType.UNDEFINEDminSize- minimum number of elements in the listmaxSize- maximum number of elements in the listallowDuplicates- validate duplicates in list or not
-
-
Method Details
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException Description copied from class:ModelTypeValidatorValidate the parameter with the given name.- Specified by:
validateParameterin interfaceParameterValidator- Overrides:
validateParameterin classModelTypeValidator- Parameters:
parameterName- the name of the parameter. Cannot benullvalue- the parameter value. Cannot benull- Throws:
OperationFailedException- if the value is not valid
-
getMin
Description copied from interface:MinMaxValidatorGets the minimum, if there is one.- Specified by:
getMinin interfaceMinMaxValidator- Returns:
- the minimum value, or
nullif there is no minimum
-
getMax
Description copied from interface:MinMaxValidatorGets the maximum, if there is one.- Specified by:
getMaxin interfaceMinMaxValidator- Returns:
- the maximum value, or
nullif there is no minimum
-