net.sourceforge.pmd

## Class SourceCodeProcessor

- java.lang.Object
- - net.sourceforge.pmd.SourceCodeProcessor

    public class SourceCodeProcessor
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`SourceCodeProcessor(PMDConfiguration configuration)`

### Method Summary

Methods
`void` `processSourceCode(InputStream sourceCode, RuleSets ruleSets, RuleContext ctx)` Processes the input stream against a rule set using the given input encoding.
`void` `processSourceCode(Reader sourceCode, RuleSets ruleSets, RuleContext ctx)` Processes the input stream against a rule set using the given input encoding.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SourceCodeProcessor

    public SourceCodeProcessor(PMDConfiguration configuration)

### Method Detail

#### processSourceCode

    public void processSourceCode(InputStream sourceCode,
                         RuleSets ruleSets,
                         RuleContext ctx)
                           throws PMDException

Processes the input stream against a rule set using the given input encoding.

Parameters:
  `sourceCode` - The InputStream to analyze.
  `ruleSets` - The collection of rules to process against the file.
  `ctx` - The context in which PMD is operating.
Throws:
  `PMDException` - if the input encoding is unsupported, the input stream could not be parsed, or other error is encountered.
See Also:
  `processSourceCode(Reader, RuleSets, RuleContext)`

#### processSourceCode

    public void processSourceCode(Reader sourceCode,
                         RuleSets ruleSets,
                         RuleContext ctx)
                           throws PMDException

Processes the input stream against a rule set using the given input encoding. If the LanguageVersion is `null` on the RuleContext, it will be automatically determined. Any code which wishes to process files for different Languages, will need to be sure to either properly set the Language on the RuleContext, or set it to `null` first.

Parameters:
  `sourceCode` - The Reader to analyze.
  `ruleSets` - The collection of rules to process against the file.
  `ctx` - The context in which PMD is operating.
Throws:
  `PMDException` - if the input encoding is unsupported, the input stream could not be parsed, or other error is encountered.
See Also:
  `RuleContext.setLanguageVersion(LanguageVersion)`, `PMDConfiguration.getLanguageVersionOfFile(String)`