|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICriterion
Method Summary | |
---|---|
void |
addPart(ICriterion criterion)
adds a criterion(or rule) to the list of criterion(rule parts or nested rules) that are executed when this Criterion(rule) is evaluated. |
boolean |
apply(IValidationContext context,
Object target)
apply this rule to the given target using the given context. |
String |
getAttribute(String name)
retrieves the attribute with the given name for this rule |
ICriterion |
getParent()
return the parent rule of this rule. |
ICriterion[] |
getParts()
returns the criterion(rule) parts or nested criteria(rules) for the criterion/rule |
IRuleSet |
getRuleSet()
return the IRuleSet containing this IRule. |
void |
initialize(Object content)
initialize this rule with any content that might be necessary for its application to a target during the invocation of the apply method. |
void |
setAttribute(String name,
String value)
set an arbitrary attribute for this rule |
void |
setParent(ICriterion parent)
set the parent rule of this rule. |
void |
setParts(ICriterion[] criterion)
set the criterion(rule) parts or nested criterion(rules) for this criterion(rule). |
void |
setRuleSet(IRuleSet iRuleSet)
Set the containing IRuleSet for this rule. |
Method Detail |
---|
void addPart(ICriterion criterion)
criterion
- - criterion which encapsulates rulevoid setParts(ICriterion[] criterion)
criterion
- - list of encapsulated rules(Criterion)ICriterion[] getParts()
void setParent(ICriterion parent)
parent
- ruleICriterion getParent()
IRuleSet getRuleSet()
void setRuleSet(IRuleSet iRuleSet)
iRuleSet
- parent ruleString getAttribute(String name)
name
- name of attribute
null
void setAttribute(String name, String value)
name
- name of attributevalue
- value of attributeboolean apply(IValidationContext context, Object target) throws Exception
Note that the context object can be used to retrieve a great deal of information about the current validation process. In particular, it can be used to update the validation report being generated with the violations that result from an application of this rule to the given target.
context
- context under which rule is being evaluated (supplied by engine)target
- object to which rule is to be applied
Exception
initialize(Object)
,
IValidationContext
,
ValidationContextConstants
void initialize(Object content) throws Exception
apply
method.
The specified content may take any form. It may be an XML element, a
.properties file, a string, etc. This method may be invoked any time prior to calling
apply
.
content
- - initialization content for the rule
Exception
apply(IValidationContext, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |