Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cocoon.forms.datatype.validationruleimpl
Class RangeValidationRule

    java.lang.Object
      org.apache.cocoon.forms.datatype.validationruleimpl.AbstractValidationRule
          org.apache.cocoon.forms.datatype.validationruleimpl.RangeValidationRule

All Implemented Interfaces:
  ValidationRule

public class RangeValidationRule
extends AbstractValidationRule

Checks numeric ranges. Works for Integer, Long, BigDecimal, Float, Double, and Date values. Numbers are converted to the BigDecimal before comparing.

This validation rule can perform 3 different checks:

- check minimum value
- check maximum value
- check min and max values (range check)

Version:
  $Id: RangeValidationRule.java 587759 2007-10-24 03:00:37Z vgritsenko $

Constructor Summary
`RangeValidationRule()`

Method Summary
`void` | `setMaxExpr(org.outerj.expression.Expression maxExpr)`
`void` | `setMinExpr(org.outerj.expression.Expression minExpr)`
`boolean` | `supportsType(Class clazz, boolean arrayType)` Returns true if this ValidationRule supports validating objects of the same class as the one specified.
`ValidationError` | `validate(Object value, org.outerj.expression.ExpressionContext expressionContext)`

Methods inherited from class org.apache.cocoon.forms.datatype.validationruleimpl.AbstractValidationRule
`evaluateComparable, evaluateNumeric, getFailMessage, hasFailMessage, setFailMessage`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RangeValidationRule

    public RangeValidationRule()

Method Detail

### setMinExpr

    public void setMinExpr(org.outerj.expression.Expression minExpr)

### setMaxExpr

    public void setMaxExpr(org.outerj.expression.Expression maxExpr)

### validate

    public ValidationError validate(Object value,
                                    org.outerj.expression.ExpressionContext expressionContext)

  Parameters:
    `value` - a value of a class supported by the ValidationRule implementation
    `expressionContext` - many validation rules use the xReporter expression interpreter, the expressionContext allows to resolve variables used in these expressions.

### supportsType

    public boolean supportsType(Class clazz,
                                boolean arrayType)

  Description copied from interface: `ValidationRule`
  Returns true if this ValidationRule supports validating objects of the same class as the one specified. If the flag 'arrayType' is true, this method will return true if this validation rule can validate arrays of these objects (i.e. the object passed to the validate method will then be an array).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.