|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRule
an interface to be implemented to add rules to the validation engine.
Method Summary | |
---|---|
void |
addRulePart(IRule rule)
adds a rule to the list of rule parts or nested rules that are executed when this rule is evaluated. |
boolean |
apply(IValidationContext context,
Object target)
apply this rule to the given target using the given context. |
String |
getAttribute(String name)
retreaves the attribute with the given name for this rule |
String |
getComponentCategory()
return the unique component category identifier in effect at the time this rule is evaluated. |
String |
getId()
get the unique id for this rule |
boolean |
getIgnoreIfNull()
returns the actf:ignoreifnull attribute for this rule |
Iterator |
getIterator(Object collection)
returns the iterator used for this rule should the rule involve any sort of collection or array. |
String |
getLongDescription()
returns the long description received upon a violation of this rule |
String |
getMessage()
returns the message resulting from violating this rule |
String |
getName()
return the name of the rule. |
IRule |
getParent()
return the parent rule of this rule. |
String |
getRepairHint()
returns the repair hint for this rule |
List |
getRuleParts()
returns the rule parts or nested rules for this rule |
IRuleSet |
getRuleSet()
return the IRuleSet containing this IRule. |
int |
getSeverity()
return the severity level for a violation of this rule. |
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. |
boolean |
isEnabled()
returns the enable attribute for this rule |
void |
setAttribute(String name,
String value)
set an arbitrary attribute for this rule |
void |
setComponentCategory(String categoryId)
set the component category identifier for this rule. |
void |
setEnabled(boolean enable)
set the enable attribute for this rule. |
void |
setId(String id)
set the id for this rule. |
void |
setIgnoreIfNull(boolean ignoreIfNull)
set the actf:ignoreifnull attribute for this rule. |
void |
setIteratorName(String clsName)
set the class name of the iterator to be used for iterating through any sort of collection. |
void |
setLongDescription(String desc)
set the long description or message to be received upon a violation of this rule. |
void |
setMessage(String msg)
set the message to be received upon a violation of this rule. |
void |
setName(String name)
set the name for this rule. |
void |
setParent(IRule parent)
set the parent rule of this rule. |
void |
setRepairHint(String hint)
set the repair hint for this rule. |
void |
setRuleParts(List ruleParts)
set the rule parts or nested rules for this rule. |
void |
setRuleSet(IRuleSet iRuleSet)
Set the containing IRuleSet for this rule. |
void |
setSeverity(int level)
set the severity level for a violation of this rule. |
Method Detail |
---|
String getName()
void setName(String name)
name
- String getId()
void setId(String id)
id
- boolean isEnabled()
void setEnabled(boolean enable)
enable
- -
true | falseString getMessage()
void setMessage(String msg)
msg
- -
message to be received upon a violation of this rulesetLongDescription(String)
String getLongDescription()
void setLongDescription(String desc)
desc
- -
long description to be received upon a violation of this rulesetMessage(String)
String getRepairHint()
void setRepairHint(String hint)
hint
- int getSeverity()
void setSeverity(int level)
org.eclipse.actf.util.logging.Reporter
.
level
- IReporter
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 anytime prior to calling
apply
.
content
- - initialization content for the rule
Exception
apply(IValidationContext, Object)
boolean apply(IValidationContext context, Object target) throws Exception
Note that the context object can be used to retreave 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
List getRuleParts()
void setRuleParts(List ruleParts)
ruleParts
- list of rule partsvoid addRulePart(IRule rule)
rule
- validation ruleIRule getParent()
void setParent(IRule parent)
parent
- ruleIRuleSet getRuleSet()
void setRuleSet(IRuleSet iRuleSet)
iRuleSet
- parent ruleString getComponentCategory()
boolean getIgnoreIfNull()
Iterator getIterator(Object collection)
ArrayIterator
is provided for
arrays and a DomNodeIterator
is provided for iterating through the
nodes of a W3C DOM level 2 NodeList
.
Other iterators may be specified using the actf:iterator attribute.
collection
- with which to initialize iterator
null
if no
iterator is requiredvoid setComponentCategory(String categoryId)
categoryId
- void setIgnoreIfNull(boolean ignoreIfNull)
ignoreIfNull
- -
true | false#apply(Object)
void setIteratorName(String clsName)
RuleConstants.ITERATOR
attribute.
clsName
- - class name of iterator to be used#getIterator(Object)Object)
,
RuleConstants.ITERATOR
String getAttribute(String name)
name
- name of attribute
null
void setAttribute(String name, String value)
name
- name of attributevalue
- value of attribute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |