|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.pmd.RuleSetFactory
| Field Summary | |
private java.lang.ClassLoader |
classLoader
|
| Constructor Summary | |
RuleSetFactory()
|
|
| Method Summary | |
RuleSet |
createRuleSet(java.io.InputStream inputStream)
Create a ruleset from an inputsteam. |
RuleSet |
createRuleSet(java.io.InputStream inputStream,
java.lang.ClassLoader classLoader)
Create a ruleset from an input stream with a specified class loader |
RuleSet |
createRuleSet(java.lang.String name)
Creates a ruleset. |
RuleSet |
createRuleSet(java.lang.String name,
java.lang.ClassLoader classLoader)
Create a ruleset from a name or from a list of name |
java.lang.ClassLoader |
getClassLoader()
Return the class loader used to load ruleset resources and rules |
java.util.Iterator |
getRegisteredRuleSets()
Returns an Iterator of RuleSet objects loaded from descriptions from the "rulesets.properties" resource or from the "rulesets.filenames" property. |
private void |
parseDescriptionNode(Rule rule,
org.w3c.dom.Node descriptionNode)
Process a rule descrtiprion node |
private void |
parseDescriptionNode(RuleSet ruleSet,
org.w3c.dom.Node descriptionNode)
Parse a ruleset description node |
private void |
parseExampleNode(Rule rule,
org.w3c.dom.Node exampleNode)
Process a rule example node |
private void |
parseExternallyDefinedRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
Process a reference to a rule |
private void |
parseInternallyDefinedRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
Process a rule definition node |
private void |
parsePriorityNode(Rule rule,
org.w3c.dom.Node priorityNode)
Parse a priority node |
private void |
parsePropertiesNode(Rule rule,
org.w3c.dom.Node propertiesNode)
Parse a properties node |
private void |
parsePropertyNode(Rule rule,
org.w3c.dom.Node propertyNode)
Parse a property node |
private void |
parseRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
Parse a rule node |
private void |
parseRuleNodeWithExclude(RuleSet ruleSet,
org.w3c.dom.Element ruleElement,
java.lang.String ref)
Parse a reference rule node with excludes |
private void |
parseRuleNodeWithSimpleReference(RuleSet ruleSet,
java.lang.String ref)
Parse a rule node with a simple reference |
private java.lang.String |
parseValueNode(org.w3c.dom.Node valueNode)
Parse a value node |
void |
setClassLoader(java.lang.ClassLoader loader)
Sets the class loader used to load ruleset resources and rules |
private java.io.InputStream |
tryToGetStreamTo(java.lang.String name,
java.lang.ClassLoader loader)
Try to load a resource with the specified class loader |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.ClassLoader classLoader
| Constructor Detail |
public RuleSetFactory()
| Method Detail |
public java.util.Iterator getRegisteredRuleSets()
throws RuleSetNotFoundException
RuleSetNotFoundException
public RuleSet createRuleSet(java.lang.String name,
java.lang.ClassLoader classLoader)
throws RuleSetNotFoundException
name - name of rule set file loaded as a resourceclassLoader - the classloader used to load the ruleset and subsequent rules
RuleSetNotFoundException
public RuleSet createRuleSet(java.lang.String name)
throws RuleSetNotFoundException
RuleSetNotFoundExceptionpublic RuleSet createRuleSet(java.io.InputStream inputStream)
inputStream - an input stream that contains a ruleset descripion
public RuleSet createRuleSet(java.io.InputStream inputStream,
java.lang.ClassLoader classLoader)
inputStream - an input stream that contains a ruleset descripionclassLoader - a class loader used to load rule classes
public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader loader)
loader - a class loader
private java.io.InputStream tryToGetStreamTo(java.lang.String name,
java.lang.ClassLoader loader)
throws RuleSetNotFoundException
name - a resource name (contains a ruleset description)loader - a class loader used to load that rule set description
RuleSetNotFoundException
private void parseDescriptionNode(RuleSet ruleSet,
org.w3c.dom.Node descriptionNode)
ruleSet - the ruleset being constructeddescriptionNode - must be a description element node
private void parseRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
RuleSetNotFoundException
ruleSet - the ruleset being constructed
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
RuleSetNotFoundException
private void parseInternallyDefinedRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
ruleSet - the ruleset being constructedruleNode - must be a rule element node
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
private void parseExternallyDefinedRuleNode(RuleSet ruleSet,
org.w3c.dom.Node ruleNode)
throws RuleSetNotFoundException
ruleSet - the ruleset being constructuctedruleNode - must be a ruke element node
RuleSetNotFoundException
private void parseRuleNodeWithSimpleReference(RuleSet ruleSet,
java.lang.String ref)
throws RuleSetNotFoundException
ruleSet - the ruleset being constructedref - a reference to a rule
RuleSetNotFoundException
private void parseRuleNodeWithExclude(RuleSet ruleSet,
org.w3c.dom.Element ruleElement,
java.lang.String ref)
throws RuleSetNotFoundException
ruleSet - the ruleset being constructedruleElement - must be a rule elementref - the ruleset reference
RuleSetNotFoundException
private void parseDescriptionNode(Rule rule,
org.w3c.dom.Node descriptionNode)
rule - the rule being constructeddescriptionNode - must be a description element node
private void parseExampleNode(Rule rule,
org.w3c.dom.Node exampleNode)
rule - the rule being constructedexampleNode - must be a example element node
private void parsePriorityNode(Rule rule,
org.w3c.dom.Node priorityNode)
rule - the rule being constructedpriorityNode - must be a priority element
private void parsePropertiesNode(Rule rule,
org.w3c.dom.Node propertiesNode)
rule - the rule being constructedpropertiesNode - must be a properties element node
private void parsePropertyNode(Rule rule,
org.w3c.dom.Node propertyNode)
rule - the rule being constructedpropertyNode - must be a property element nodeprivate java.lang.String parseValueNode(org.w3c.dom.Node valueNode)
valueNode - must be a value element node
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||