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
ParameterValidatorthat validates undefined values and expression types, delegating to a provided validator for everything else.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Constructor Summary
Constructors Constructor Description NillableOrExpressionParameterValidator(ParameterValidator delegate, Boolean allowNull, boolean allowExpression)Creates a newNillableOrExpressionParameterValidator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.jboss.dmr.ModelNode>getAllowedValues()Gets the allowed values, ornullif any value is allowed.BooleangetAllowNull()ParameterValidatorgetDelegate()LonggetMax()Gets the maximum, if there is one.LonggetMin()Gets the minimum, if there is one.booleanisAllowExpression()voidvalidateParameter(String parameterName, org.jboss.dmr.ModelNode value)Validate the parameter with the given name.
-
-
-
Constructor Detail
-
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 Detail
-
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
public Long 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
public Long 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
public ParameterValidator getDelegate()
-
getAllowNull
public Boolean getAllowNull()
-
isAllowExpression
public boolean isAllowExpression()
-
getAllowedValues
public List<org.jboss.dmr.ModelNode> getAllowedValues()
Description copied from interface:AllowedValuesValidatorGets the allowed values, ornullif any value is allowed.- Specified by:
getAllowedValuesin interfaceAllowedValuesValidator- Returns:
- the allowed values, or
null
-
-