Class NillableOrExpressionParameterValidator
java.lang.Object
org.jboss.as.controller.operations.validation.NillableOrExpressionParameterValidator
- All Implemented Interfaces:
AllowedValuesValidator,MinMaxValidator,ParameterValidator
public class NillableOrExpressionParameterValidator
extends Object
implements ParameterValidator, MinMaxValidator, AllowedValuesValidator
ParameterValidator that validates undefined values and expression types, delegating to a provided
validator for everything else.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionNillableOrExpressionParameterValidator(ParameterValidator delegate, Boolean allowNull, boolean allowExpression) Creates a newNillableOrExpressionParameterValidator. -
Method Summary
Modifier and TypeMethodDescriptionList<org.jboss.dmr.ModelNode>Gets the allowed values, ornullif any value is allowed.getMax()Gets the maximum, if there is one.getMin()Gets the minimum, if there is one.booleanvoidvalidateParameter(String parameterName, org.jboss.dmr.ModelNode value) Validate the parameter with the given name.
-
Constructor Details
-
NillableOrExpressionParameterValidator
public NillableOrExpressionParameterValidator(ParameterValidator delegate, Boolean allowNull, boolean allowExpression) Creates a newNillableOrExpressionParameterValidator.- Parameters:
delegate- validator to delegate to once null and expression validation is done. Cannot benullallowNull- whether undefined values are allowed. If this param isnull, checking for undefined is delegated to the provideddelegateallowExpression- whether expressions are allowed- Throws:
IllegalArgumentException- ifdelegateisnull
-
-
Method Details
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException Description copied from interface:ParameterValidatorValidate the parameter with the given name.- Specified by:
validateParameterin interfaceParameterValidator- 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
-
getDelegate
-
getAllowNull
-
isAllowExpression
public boolean isAllowExpression() -
getAllowedValues
Description copied from interface:AllowedValuesValidatorGets the allowed values, ornullif any value is allowed.- Specified by:
getAllowedValuesin interfaceAllowedValuesValidator- Returns:
- the allowed values, or
null
-