Class FieldReference
java.lang.Object
org.apache.fulcrum.intake.validator.FieldReference
Helper Class to manage relations between fields. The following
comparisons are supported:
Name | Valid Values | Default 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$
- Author:
- Thomas Vandahl
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
checkReferences
(List<FieldReference> fieldReferences, CompareCallback<T> compareCallback, T value, Group group) Check the parsed value against the referenced fieldsstatic FieldReference.Comparison
getComparisonType
(String key) Map the comparison strings to their numeric counterpartsvoid
setComparison
(FieldReference.Comparison compare) void
setFieldName
(String fieldName) void
setMessage
(String message)
-
Constructor Details
-
FieldReference
public FieldReference()Constructor
-
-
Method Details
-
getComparison
- Returns:
- the comparison type
-
setComparison
- Parameters:
compare
- the comparison type to set
-
getFieldName
- Returns:
- the field name
-
setFieldName
- Parameters:
fieldName
- the field name to set
-
getMessage
- Returns:
- the message
-
setMessage
- Parameters:
message
- the message to set
-
getComparisonType
Map the comparison strings to their numeric counterparts- Parameters:
key
- the string representation of a comparison operator- Returns:
- 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- Type Parameters:
T
- the field type- Parameters:
fieldReferences
- List of field references to checkcompareCallback
- Callback to the actual compare operationvalue
- the parsed value of the related fieldgroup
- the group the related field belongs to- Throws:
ValidationException
- if the validation against at least one related field fails
-