org.sapia.validator.rules
Class ForEach
java.lang.Object
org.sapia.validator.Rule
org.sapia.validator.CompositeRule
org.sapia.validator.rules.ForEach
- All Implemented Interfaces:
- org.sapia.util.xml.confix.ObjectCreationCallback, org.sapia.util.xml.confix.ObjectHandlerIF, Validatable
public class ForEach
- extends CompositeRule
Aggregates one-to-many nested validatable(s), iterating over the items
in a collection/iterator/array and passing each item to the
validate method of the nested validatable(s).
- Author:
- Yanick Duchesne
- Copyright:
- Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
- License:
- Read the license.txt file of the jar or visit the
license page at the Sapia OSS web site
- See Also:
Validatable,
Validatable.validate(ValidationContext)
|
Constructor Summary |
ForEach()
Constructor for ForEach. |
|
Method Summary |
void |
setAttribute(String attr)
Sets the name of the accessor that will be used to retreive
a collection or array to validate from the current object on the
validation context's stack. |
void |
validate(ValidationContext ctx)
Validates this instance. |
| Methods inherited from class org.sapia.validator.Rule |
createMessage, getErrorMessageFor, getErrorMessages, getId, initName, localName, onCreate, prefix, qualifiedName, setErrorMessages, setId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ForEach
public ForEach()
- Constructor for ForEach.
setAttribute
public void setAttribute(String attr)
- Sets the name of the accessor that will be used to retreive
a collection or array to validate from the current object on the
validation context's stack.
- Parameters:
attr - the name of an accessor.
validate
public void validate(ValidationContext ctx)
- Description copied from interface:
Validatable
- Validates this instance.
- Specified by:
validate in interface Validatable- Overrides:
validate in class CompositeRule
- See Also:
CompositeRule.validate(ValidationContext)
Copyright © 2002 Sapia Open Community, Inc. All Rights Reserved.