net.sourceforge.pmd.lang

## Class AbstractParser

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

All Implemented Interfaces:
  Parser

Direct Known Subclasses:
  AbstractJavaParser, CppParser, Ecmascript3Parser, JspParser, XmlParser

    public abstract class AbstractParser
    extends Object
    implements Parser

This is a generic implementation of the Parser interface.

See Also:
  `Parser`

### Field Summary

Fields
`protected ParserOptions` `parserOptions`

### Constructor Summary

Constructors
Constructor and Description
`AbstractParser(ParserOptions parserOptions)`

### Method Summary

Methods
`protected abstract TokenManager` `createTokenManager(Reader source)`
`ParserOptions` `getParserOptions()` Get the ParserOptions used by this Parser.
`TokenManager` `getTokenManager(String fileName, Reader source)` Get a TokenManager for the given source.

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

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

### Methods inherited from interface net.sourceforge.pmd.lang.Parser

`canParse, getSuppressMap, parse`

### Field Detail

#### parserOptions

    protected final ParserOptions parserOptions

### Constructor Detail

#### AbstractParser

    public AbstractParser(ParserOptions parserOptions)

### Method Detail

#### getParserOptions

    public ParserOptions getParserOptions()

Description copied from interface: `Parser`
Get the ParserOptions used by this Parser.

Specified by:
  `getParserOptions` in interface `Parser`

#### getTokenManager

    public TokenManager getTokenManager(String fileName,
                               Reader source)

Description copied from interface: `Parser`
Get a TokenManager for the given source.

Specified by:
  `getTokenManager` in interface `Parser`
Parameters:
  `fileName` - The file name being parsed (may be `null`).
  `source` - Reader that provides the source code to tokenize.
Returns:
  A TokenManager for reading token.

#### createTokenManager

    protected abstract TokenManager createTokenManager(Reader source)