org.eclipse.actf.validation.rules
Class EqRule
java.lang.Object
org.eclipse.actf.validation.rules.AbstractCriterion
org.eclipse.actf.validation.rules.AbstractRule
org.eclipse.actf.validation.rules.EqRule
- All Implemented Interfaces:
- ICriterion, IRule
public class EqRule
- extends AbstractRule
embodies the actf:eq rule
- Author:
- John Buslawski
Method Summary |
boolean |
apply(IValidationContext context,
Object target)
insures that either the target is not null or that,
if the target is null , null targets can be ignored |
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. |
Methods inherited from class org.eclipse.actf.validation.rules.AbstractRule |
findComponentCategory, findMessage, findRuleId, getAliasValue, getComponentCategory, getCriterionFactory, getId, getIgnoreIfNull, getIterator, getLongDescription, getMessage, getName, getRepairHint, getSeverity, getTextTrim, isEnabled, isIgnoringNullTarget, processActfAttributes, report, setComponentCategory, setEnabled, setId, setIgnoreIfNull, setIteratorName, setLongDescription, setMessage, setName, setRepairHint, setSeverity, toString |
Methods inherited from class org.eclipse.actf.validation.rules.AbstractCriterion |
addPart, equals, getAttribute, getParent, getParts, getRuleSet, hashCode, setAttribute, setParent, setParts, setRuleSet |
EqRule
public EqRule()
initialize
public void initialize(Object content)
throws Exception
- initialize this rule with any content that might be necessary for its
application to a target during the invocation of the
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
.
- Parameters:
content
- - initialization content for the rule
- Throws:
Exception
- See Also:
ICriterion.apply(IValidationContext, Object)
apply
public boolean apply(IValidationContext context,
Object target)
throws Exception
- insures that either the target is not
null
or that,
if the target is null
, null targets can be ignored
- Specified by:
apply
in interface ICriterion
- Overrides:
apply
in class AbstractRule
- Parameters:
context
- context under which rule is being evaluated (supplied by engine)target
- object to which rule is to be applied
- Returns:
- whether or not the target violates the rule
- Throws:
Exception
- See Also:
ICriterion.initialize(Object)
,
IValidationContext
,
ValidationContextConstants