org.apache.turbine.services.intake.validator
Class FieldReference

java.lang.Object
  extended byorg.apache.turbine.services.intake.validator.FieldReference

public class FieldReference
extends java.lang.Object

Helper Class to manage relations between fields. The following comparisons are supported:

NameValid ValuesDefault Value
less-than <name of other field>  
greater-than <name of other field>  
less-than-or-equal <name of other field>  
greater-than-or-equal <name of other field>  

Version:
$Id: DateStringValidator.java 534527 2007-05-02 16:10:59Z tv $
Author:
Thomas Vandahl

Field Summary
static int COMPARE_GT
          Integer value for ">" comparison
static int COMPARE_GTE
          Integer value for ">=" comparison
static int COMPARE_LT
          Integer value for "<" comparison
static int COMPARE_LTE
          Integer value for "<=" comparison
protected static org.apache.commons.logging.Log log
          a local logger
static java.lang.String RANGE_GT
          Rule name for ">" comparison
static java.lang.String RANGE_GTE
          Rule name for ">=" comparison
static java.lang.String RANGE_LT
          Rule name for "<" comparison
static java.lang.String RANGE_LTE
          Rule name for "<=" comparison
 
Constructor Summary
FieldReference()
          Constructor
 
Method Summary
static void checkReferences(java.util.List fieldReferences, CompareCallback compareCallback, java.lang.Object value, Group group)
          Check the parsed value against the referenced fields
 int getCompare()
           
static int getCompareType(java.lang.String key)
          Map the comparison strings to their numeric counterparts
 java.lang.String getFieldName()
           
 java.lang.String getMessage()
           
 void setCompare(int compare)
           
 void setFieldName(java.lang.String fieldName)
           
 void setMessage(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
a local logger


RANGE_LT

public static final java.lang.String RANGE_LT
Rule name for "<" comparison

See Also:
Constant Field Values

RANGE_GT

public static final java.lang.String RANGE_GT
Rule name for ">" comparison

See Also:
Constant Field Values

RANGE_LTE

public static final java.lang.String RANGE_LTE
Rule name for "<=" comparison

See Also:
Constant Field Values

RANGE_GTE

public static final java.lang.String RANGE_GTE
Rule name for ">=" comparison

See Also:
Constant Field Values

COMPARE_LT

public static final int COMPARE_LT
Integer value for "<" comparison

See Also:
Constant Field Values

COMPARE_GT

public static final int COMPARE_GT
Integer value for ">" comparison

See Also:
Constant Field Values

COMPARE_LTE

public static final int COMPARE_LTE
Integer value for "<=" comparison

See Also:
Constant Field Values

COMPARE_GTE

public static final int COMPARE_GTE
Integer value for ">=" comparison

See Also:
Constant Field Values
Constructor Detail

FieldReference

public FieldReference()
Constructor

Method Detail

getCompare

public int getCompare()
Returns:
the comparison type

setCompare

public void setCompare(int compare)
Parameters:
compare - the comparison type to set

getFieldName

public java.lang.String getFieldName()
Returns:
the field name

setFieldName

public void setFieldName(java.lang.String fieldName)
Parameters:
fieldName - the field name to set

getMessage

public java.lang.String getMessage()
Returns:
the message

setMessage

public void setMessage(java.lang.String message)
Parameters:
message - the message to set

getCompareType

public static int getCompareType(java.lang.String key)
Map the comparison strings to their numeric counterparts

Parameters:
key - the
Returns:

checkReferences

public static void checkReferences(java.util.List fieldReferences,
                                   CompareCallback compareCallback,
                                   java.lang.Object value,
                                   Group group)
                            throws ValidationException
Check the parsed value against the referenced fields

Parameters:
fieldReferences - List of field references to check
compareCallback - Callback to the actual compare operation
value - the parsed value of the related field
group - the group the related field belongs to
Throws:
ValidationException


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.