|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.validators.CompositeValidator
public class CompositeValidator
CompositeValidator allows the validation of one or more Validators to be chained together such that all need to validate the value for the composite to be valid.
ValidationInterface
,
Validator
,
Serialized FormField Summary | |
---|---|
protected ValidationInterface |
validator1
|
protected ValidationInterface |
validator2
|
protected java.util.List |
validators
|
Fields inherited from class com.sas.util.validators.Validator |
---|
message, messages, msgObject, RB_KEY |
Constructor Summary | |
---|---|
CompositeValidator()
Default constructor, actuall validators still need to be added to the validator. |
|
CompositeValidator(java.util.List validators)
Constructor which allows specifying a list of validators to use. |
|
CompositeValidator(ValidationInterface validator1)
Constructor which allows specifying the first validator. |
|
CompositeValidator(ValidationInterface validator1,
ValidationInterface validator2)
Constructor which allows specifying the first two validators. |
Method Summary | |
---|---|
void |
addValidator(ValidationInterface validator)
Adds a validator to the end of the validation list. |
ValidationInterface |
getFirstValidator()
Deprecated. Use getValidatorAtIndex(0) instead |
ValidationInterface |
getSecondValidator()
Deprecated. Use getValidatorAtIndex(1) instead |
ValidationInterface |
getValidatorAtIndex(int index)
Returns the validator at the specified index, null if index is invalid. |
java.util.List |
getValidators()
Returns the list that contains the validators. |
void |
insertValidatorAtIndex(int index,
ValidationInterface validator)
Inserts the validator at the specified index. |
java.lang.Object |
normalizeValue(java.lang.Object component,
java.lang.Object value)
Cycles through all the validators starting at index 0 and normalizes the value. |
boolean |
removeValidator(ValidationInterface validator)
Removes the validator from the list of validators. |
void |
removeValidatorAtIndex(int index)
Removes the validator at the specifed index from the list of validators. |
void |
setFirstValidator(ValidationInterface firstValidator)
Deprecated. Use removeValidatorAtIndex(0) and then insertValidatorAtIndex(0, validator) instead |
void |
setSecondValidator(ValidationInterface secondValidator)
Deprecated. Use removeValidatorAtIndex(1) and then insertValidatorAtIndex(1, validator) instead |
void |
setValidators(java.util.List validators)
Sets the list of validators to use. |
boolean |
validateValue(java.lang.Object component,
java.lang.Object value)
Cycles through all the validators in the list. |
Methods inherited from class com.sas.util.validators.Validator |
---|
createValidationMessages, getExtendedBeanInfo, getValidationMessage, getValidationMessageCode, newValidationMessage, setValidationMessage, setValidationMessageCode |
Field Detail |
---|
protected ValidationInterface validator1
protected ValidationInterface validator2
protected java.util.List validators
Constructor Detail |
---|
public CompositeValidator()
public CompositeValidator(ValidationInterface validator1)
validator1
- The first validator to runpublic CompositeValidator(ValidationInterface validator1, ValidationInterface validator2)
validator1
- The first validator to runvalidator2
- The second validator to runpublic CompositeValidator(java.util.List validators)
validators
- The list of validators to runMethod Detail |
---|
public void addValidator(ValidationInterface validator)
validator
- The validator to append to the end of the validation list.public boolean removeValidator(ValidationInterface validator)
validator
- The validator to remove from the list of validators.
public void removeValidatorAtIndex(int index)
index
- The index of the validator to remove from the list of validators.public boolean validateValue(java.lang.Object component, java.lang.Object value)
validateValue
in interface ValidationInterface
validateValue
in class Validator
component
- an object containing the valuevalue
- the value to be validated
ValidationInterface.validateValue(java.lang.Object, java.lang.Object)
public java.lang.Object normalizeValue(java.lang.Object component, java.lang.Object value)
normalizeValue
in interface ValidationInterface
normalizeValue
in class Validator
component
- an object containing the valuevalue
- the value to be normalized
ValidationInterface.normalizeValue(java.lang.Object, java.lang.Object)
public ValidationInterface getValidatorAtIndex(int index)
index
- the index of the validator to return
public void insertValidatorAtIndex(int index, ValidationInterface validator)
index
- the index to insert the validator atvalidator
- the validator to insert at the indexpublic java.util.List getValidators()
public void setValidators(java.util.List validators)
validators
- the list of validators to use.public ValidationInterface getFirstValidator()
public void setFirstValidator(ValidationInterface firstValidator)
firstValidator
- the first validator to be run.public ValidationInterface getSecondValidator()
public void setSecondValidator(ValidationInterface secondValidator)
secondValidator
- the second validator to be run.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |