public class RequiredIfConstraint extends ParsedConstraint
Constructor and Description |
---|
RequiredIfConstraint(java.lang.String identifierIn)
This will create a new
Constraints with the specified
identifier as the "name". |
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String fieldNameIn,
java.lang.String fieldValueIn)
Set the name of the field to check against to see if *this* field
is required.
|
boolean |
isRequired(java.lang.Object value,
java.lang.Object objectToCheck)
Check the constraint against the value passed in as well as check the
objectToCheck's referenced field that is 'requiredIf'.
|
checkConstraint, getASCII, getDataType, getIdentifier, getOptional, getPosix, getUserName, isPosix, isValidUserName, setASCII, setDataType, setOptional, setPosix, setUserName, toString
public RequiredIfConstraint(java.lang.String identifierIn)
This will create a new Constraints
with the specified
identifier as the "name".
identifierIn
- String
identifier for Constraint
.public boolean isRequired(java.lang.Object value, java.lang.Object objectToCheck)
value
- the value we want to check to see if its valid or not only
if the objectToCheck's referenced requiredIf field is set to the
proper value.objectToCheck
- the Object we will query to find the associated fieldpublic void addField(java.lang.String fieldNameIn, java.lang.String fieldValueIn)
fieldNameIn
- the name of the fieldfieldValueIn
- the value of the field