## net.sourceforge.pmd
Class RuleSetFactory

    java.lang.Object
      net.sourceforge.pmd.RuleSetFactory

public class RuleSetFactory
extends java.lang.Object

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)` Deprecated. Use createRuleSets instead, because this method puts all rules in one single RuleSet object, and thus removes name and language of the originating rule set files.
`RuleSet` `createRuleSet(java.lang.String name, java.lang.ClassLoader classLoader)` Deprecated. Use createRuleSets instead, because this method puts all rules in one single RuleSet object, and thus removes name and language of the originating rule set files.
`RuleSets` `createRuleSets(java.lang.String ruleSetFileNames)` Create a RuleSets from a list of names, using the classloader of this class.
`RuleSets` `createRuleSets(java.lang.String ruleSetFileNames, java.lang.ClassLoader classLoader)` Create a RuleSets from a list of names.
`RuleSet` `createSingleRuleSet(java.lang.String ruleSetFileName)` Create a ruleset from a name
`RuleSet` `createSingleRuleSet(java.lang.String ruleSetFileName, java.lang.ClassLoader classLoader)` Create a ruleset from a name
`java.util.Iterator` `getRegisteredRuleSets()` Returns an Iterator of RuleSet objects loaded from descriptions from the "rulesets.properties" resource.
`void` `setMinimumPriority(int minPriority)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RuleSetFactory

    public RuleSetFactory()

Method Detail

### setMinimumPriority

    public void setMinimumPriority(int minPriority)

### getRegisteredRuleSets

    public java.util.Iterator getRegisteredRuleSets()
                                             throws RuleSetNotFoundException

  Returns an Iterator of RuleSet objects loaded from descriptions from the "rulesets.properties" resource.

  Returns:
    an iterator of RuleSet objects
  Throws:
    `RuleSetNotFoundException`

### createRuleSets

    public RuleSets createRuleSets(java.lang.String ruleSetFileNames,
                                   java.lang.ClassLoader classLoader)
                            throws RuleSetNotFoundException

  Create a RuleSets from a list of names.

  Parameters:
    `ruleSetFileNames` - comma-separated list of rule set files.
  Throws:
    `RuleSetNotFoundException`

### createRuleSets

    public RuleSets createRuleSets(java.lang.String ruleSetFileNames)
                            throws RuleSetNotFoundException

  Create a RuleSets from a list of names, using the classloader of this class.

  Parameters:
    `ruleSetFileNames` - comma-separated list of rule set files.
  Throws:
    `RuleSetNotFoundException`

### createRuleSet

    public RuleSet createRuleSet(java.lang.String name,
                                 java.lang.ClassLoader classLoader)
                          throws RuleSetNotFoundException

  Deprecated. Use createRuleSets instead, because this method puts all rules in one single RuleSet object, and thus removes name and language of the originating rule set files.

  Create a ruleset from a name or from a list of names

  Parameters:
    `name` - name of rule set file loaded as a resource
    `classLoader` - the classloader used to load the ruleset and subsequent rules
  Returns:
    the new ruleset
  Throws:
    `RuleSetNotFoundException`

### createRuleSet

    public RuleSet createRuleSet(java.lang.String name)
                          throws RuleSetNotFoundException

  Deprecated. Use createRuleSets instead, because this method puts all rules in one single RuleSet object, and thus removes name and language of the originating rule set files.

  Creates a ruleset. If passed a comma-delimited string (rulesets/basic.xml,rulesets/unusedcode.xml) it will parse that string and create a new ruleset for each item in the list. Same as createRuleSet(name, ruleSetFactory.getClassLoader()).

  Parameters:
    `name` - name of rule set file loaded as a resource
  Throws:
    `RuleSetNotFoundException`

### createSingleRuleSet

    public RuleSet createSingleRuleSet(java.lang.String ruleSetFileName,
                                       java.lang.ClassLoader classLoader)
                                throws RuleSetNotFoundException

  Create a ruleset from a name

  Parameters:
    `classLoader` - the classloader used to load the ruleset and subsequent rules
  Returns:
    the new ruleset
  Throws:
    `RuleSetNotFoundException`

### createSingleRuleSet

    public RuleSet createSingleRuleSet(java.lang.String ruleSetFileName)
                                throws RuleSetNotFoundException

  Create a ruleset from a name

  Returns:
    the new ruleset
  Throws:
    `RuleSetNotFoundException`

### createRuleSet

    public RuleSet createRuleSet(java.io.InputStream inputStream)

  Create a ruleset from an inputsteam. Same as createRuleSet(inputStream, ruleSetFactory.getClassLoader()).

  Parameters:
    `inputStream` - an input stream that contains a ruleset descripion
  Returns:
    a new ruleset

### createRuleSet

    public RuleSet createRuleSet(java.io.InputStream inputStream,
                                 java.lang.ClassLoader classLoader)

  Create a ruleset from an input stream with a specified class loader

  Parameters:
    `inputStream` - an input stream that contains a ruleset descripion
    `classLoader` - a class loader used to load rule classes
  Returns:
    a new ruleset

Copyright © 2002-2006 InfoEther. All Rights Reserved.