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
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, ornull
if any value is allowed.Boolean
getAllowNull()
ParameterValidator
getDelegate()
Long
getMax()
Gets the maximum, if there is one.Long
getMin()
Gets the minimum, if there is one.boolean
isAllowExpression()
void
validateParameter(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 benull
allowNull
- whether undefined values are allowed. If this param isnull
, checking for undefined is delegated to the provideddelegate
allowExpression
- whether expressions are allowed- Throws:
IllegalArgumentException
- ifdelegate
isnull
-
-
Method Detail
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException
Description copied from interface:ParameterValidator
Validate the parameter with the given name.- Specified by:
validateParameter
in interfaceParameterValidator
- Parameters:
parameterName
- the name of the parameter. Cannot benull
value
- the parameter value. Cannot benull
- Throws:
OperationFailedException
- if the value is not valid
-
getMin
public Long getMin()
Description copied from interface:MinMaxValidator
Gets the minimum, if there is one.- Specified by:
getMin
in interfaceMinMaxValidator
- Returns:
- the minimum value, or
null
if there is no minimum
-
getMax
public Long getMax()
Description copied from interface:MinMaxValidator
Gets the maximum, if there is one.- Specified by:
getMax
in interfaceMinMaxValidator
- Returns:
- the maximum value, or
null
if 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:AllowedValuesValidator
Gets the allowed values, ornull
if any value is allowed.- Specified by:
getAllowedValues
in interfaceAllowedValuesValidator
- Returns:
- the allowed values, or
null
-
-