Klasse FieldReference

java.lang.Object
org.apache.fulcrum.intake.validator.FieldReference

public class FieldReference extends Object
Helper Class to manage relations between fields. The following comparisons are supported:
Validation rules
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$
Autor:
Thomas Vandahl
  • Konstruktordetails

    • FieldReference

      public FieldReference()
      Constructor
  • Methodendetails

    • getComparison

      public FieldReference.Comparison getComparison()
      Gibt zurück:
      the comparison type
    • setComparison

      public void setComparison(FieldReference.Comparison compare)
      Parameter:
      compare - the comparison type to set
    • getFieldName

      public String getFieldName()
      Gibt zurück:
      the field name
    • setFieldName

      public void setFieldName(String fieldName)
      Parameter:
      fieldName - the field name to set
    • getMessage

      public String getMessage()
      Gibt zurück:
      the message
    • setMessage

      public void setMessage(String message)
      Parameter:
      message - the message to set
    • getComparisonType

      public static FieldReference.Comparison getComparisonType(String key)
      Map the comparison strings to their numeric counterparts
      Parameter:
      key - the string representation of a comparison operator
      Gibt zurück:
      the numeric representation of the given comparison operator
    • checkReferences

      public static <T> void checkReferences(List<FieldReference> fieldReferences, CompareCallback<T> compareCallback, T value, Group group) throws ValidationException
      Check the parsed value against the referenced fields
      Typparameter:
      T - the field type
      Parameter:
      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
      Löst aus:
      ValidationException - if the validation against at least one related field fails