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 Details

    • NillableOrExpressionParameterValidator

      public NillableOrExpressionParameterValidator(ParameterValidator delegate, Boolean allowNull, boolean allowExpression)
      Creates a new NillableOrExpressionParameterValidator.
      Parameters:
      delegate - validator to delegate to once null and expression validation is done. Cannot be null
      allowNull - whether undefined values are allowed. If this param is null, checking for undefined is delegated to the provided delegate
      allowExpression - whether expressions are allowed
      Throws:
      IllegalArgumentException - if delegate is null
  • Method Details

    • 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 interface ParameterValidator
      Parameters:
      parameterName - the name of the parameter. Cannot be null
      value - the parameter value. Cannot be null
      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 interface MinMaxValidator
      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 interface MinMaxValidator
      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, or null if any value is allowed.
      Specified by:
      getAllowedValues in interface AllowedValuesValidator
      Returns:
      the allowed values, or null