|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.value.validator.base.AbstractCompositeValueValidator
public abstract class AbstractCompositeValueValidator
This is an abstract base implementation of a composite ValueValidatorIF.
| Field Summary |
|---|
| Fields inherited from interface net.sf.mmm.value.validator.api.ValueValidator |
|---|
XML_ATR_VALIDATOR_TYPE, XML_TAG_VALIDATOR |
| Constructor Summary | |
|---|---|
AbstractCompositeValueValidator()
The constructor. |
|
| Method Summary | |
|---|---|
void |
add(ValueValidator child)
This method adds a child validator to this composite validator. |
ValueValidator |
getChild(int index)
This method gets the child validator at the given position. |
int |
getChildCount()
This method gets the number of child validators. |
protected int |
getMaximumRequiredValidChildren()
This method gets the maximum number of child validators that must succeed until no further child validators are evaluated. |
protected abstract ValidationResult |
getResult(ValidationResult[] details,
int detailCount,
int succeedCount)
This method is called after the child validators are evaluated and creates the validation result of the collected information. |
protected ValidationResult |
getResultIfEmpty()
This method gets the validation result if this composite validator has no children. |
ValidationResult |
validate(Object value)
This method validates the given value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractCompositeValueValidator()
| Method Detail |
|---|
public int getChildCount()
public ValueValidator getChild(int index)
index - is the position of the requested child validator.
public void add(ValueValidator child)
child - is the new child validator to add.protected ValidationResult getResultIfEmpty()
protected abstract ValidationResult getResult(ValidationResult[] details,
int detailCount,
int succeedCount)
details - is the array containing the invalid results of the child
validtors.detailCount - is the number of invalid results in the array (may be
less than the array length).succeedCount - is the number of child validators that succeeded.
protected int getMaximumRequiredValidChildren()
1. Then the
getResult(ValidationResult[], int, int)
method will be called after the first validator suceeded. Integer.MAX_VALUE so all child
validators are always performed.
public ValidationResult validate(Object value)
validate in interface ValueValidatorvalue - the value to validate. It may be null but its
not allowed to throw a NullPointerException for this reason.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||