|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.validation.valdoc.rulebase.ReflectionDocumentCriterionFactory
public class ReflectionDocumentCriterionFactory
The IRuleFactory for ACTF rules.
Field Summary | |
---|---|
protected static Map |
ruleMap
|
Constructor Summary | |
---|---|
ReflectionDocumentCriterionFactory()
|
Method Summary | |
---|---|
protected IRule |
createRule(Element ruleElem)
|
protected IRule |
createRule(Element ruleElement,
ICriterion parent)
|
protected List<IRule> |
createRulesForCriterion(Element ruleElem)
|
protected String |
getAliasValue(String name)
|
ICodeProcessor |
getCodeProcessor()
|
ICriterionMapping |
getCriterionMapping(Object rulesetToken)
retrieves a criterion mapping that maps a type of object to a set of rules. For a ReflectionDocument ,the mapping will consist of a Java type
mapped to a set of rules to be applied to instances of that type. |
IRuleBase |
getRuleBase()
|
IRule |
getRuleInstance(String name)
gets an instance of the validation rule for the given name. |
IRule |
getRuleInstance(String name,
IRule parent)
creates and initializes a validation rule for the given name. |
IRuleSet |
getRuleSet()
|
boolean |
isRuleAttribute(String name)
Checks to see the parameter is a rule Attribute |
ICriterion |
makeCriterionInstance(Object obj)
Makes an instance of the criterion using the object. |
ICriterion |
makeCriterionInstance(Object obj,
ICriterion parent)
Makes an instance of the criterion using the object having the specified parent. |
protected void |
processRuleElement(Element ruleElem,
Map<ICriterion,List<IRule>> criteriaRuleMap)
|
void |
registerRuleClassName(String name,
String ruleClassName)
registers a validation rule class for the given type |
void |
setCodeProcessor(ICodeProcessor codeProc)
|
void |
setRuleBase(IRuleBase ruleBase)
set the rulebase for this factory |
void |
setRuleSet(IRuleSet ruleSet)
set the ruleset for this factory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Map ruleMap
Constructor Detail |
---|
public ReflectionDocumentCriterionFactory()
Method Detail |
---|
public ICodeProcessor getCodeProcessor()
public void setCodeProcessor(ICodeProcessor codeProc)
public IRuleBase getRuleBase()
getRuleBase
in interface ICriterionFactory
public void setRuleBase(IRuleBase ruleBase)
ICriterionFactory
setRuleBase
in interface ICriterionFactory
public IRuleSet getRuleSet()
getRuleSet
in interface ICriterionFactory
public void setRuleSet(IRuleSet ruleSet)
ICriterionFactory
setRuleSet
in interface ICriterionFactory
public ICriterionMapping getCriterionMapping(Object rulesetToken)
For a ReflectionDocument
,the mapping will consist of a Java type
mapped to a set of rules to be applied to instances of that type. The type is
typically aliased and is the name of the element defining a particular set of rules
within a ruleset.
Hence, the 'rulesetToken' should be an instance of org.w3c.dom.Element
,
having a name that specifies the type for which rules represented by its child elements
are to be applied.
getCriterionMapping
in interface ICriterionFactory
rulesetToken
- - ruleset (or token of ruleset) associated with this factory
protected void processRuleElement(Element ruleElem, Map<ICriterion,List<IRule>> criteriaRuleMap)
protected List<IRule> createRulesForCriterion(Element ruleElem)
protected IRule createRule(Element ruleElement, ICriterion parent)
protected IRule createRule(Element ruleElem)
protected String getAliasValue(String name)
public void registerRuleClassName(String name, String ruleClassName)
ICriterionFactory
registerRuleClassName
in interface ICriterionFactory
name
- -
name under which the rule is being registeredruleClassName
- -
the class name of the rule implementationpublic IRule getRuleInstance(String name)
ICriterionFactory
registerRuleClassName
method or must be one of the
standard ACTF validation rules.
getRuleInstance
in interface ICriterionFactory
name
- -
name of the rule
null
if there was no
rule registered under that nameICriterionFactory.registerRuleClassName(String, String)
public IRule getRuleInstance(String name, IRule parent)
ICriterionFactory
registerRuleClassName
method or must be one of the
standard ACTF validation rules.
getRuleInstance
in interface ICriterionFactory
name
- -
name of the ruleparent
- -
parent rule instance
null
if there was no
rule registered under that nameICriterionFactory.registerRuleClassName(String, String)
public ICriterion makeCriterionInstance(Object obj, ICriterion parent)
ICriterionFactory
makeCriterionInstance
in interface ICriterionFactory
obj
- -
Object from which the criterion is derivedparent
- -
parent criterion instance
public ICriterion makeCriterionInstance(Object obj)
ICriterionFactory
makeCriterionInstance
in interface ICriterionFactory
obj
- -
Object from which the criterion is derived
public boolean isRuleAttribute(String name)
name
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |