Class AbstractJavaParser

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.Parser
    Direct Known Subclasses:
    JavaLanguageParser

    public abstract class AbstractJavaParser
    extends net.sourceforge.pmd.lang.AbstractParser
    This is a generic Java specific implementation of the Parser interface. It creates a JavaParser instance, and sets the exclude marker. It also exposes the exclude map from the JavaParser instance.
    See Also:
    AbstractParser, JavaParser
    • Field Summary

      • Fields inherited from class net.sourceforge.pmd.lang.AbstractParser

        parserOptions
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractJavaParser​(net.sourceforge.pmd.lang.ParserOptions parserOptions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canParse()  
      protected JavaParser createJavaParser​(java.io.Reader source)
      Subclass should override this method to modify the JavaParser as needed.
      net.sourceforge.pmd.lang.TokenManager createTokenManager​(java.io.Reader source)  
      java.util.Map<java.lang.Integer,​java.lang.String> getSuppressMap()  
      net.sourceforge.pmd.lang.ast.Node parse​(java.lang.String fileName, java.io.Reader source)  
      • Methods inherited from class net.sourceforge.pmd.lang.AbstractParser

        getParserOptions, getTokenManager
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractJavaParser

        public AbstractJavaParser​(net.sourceforge.pmd.lang.ParserOptions parserOptions)
    • Method Detail

      • createTokenManager

        public net.sourceforge.pmd.lang.TokenManager createTokenManager​(java.io.Reader source)
        Specified by:
        createTokenManager in class net.sourceforge.pmd.lang.AbstractParser
      • createJavaParser

        protected JavaParser createJavaParser​(java.io.Reader source)
                                       throws ParseException
        Subclass should override this method to modify the JavaParser as needed.
        Throws:
        ParseException
      • canParse

        public boolean canParse()
      • parse

        public net.sourceforge.pmd.lang.ast.Node parse​(java.lang.String fileName,
                                                       java.io.Reader source)
                                                throws ParseException
        Throws:
        ParseException
      • getSuppressMap

        public java.util.Map<java.lang.Integer,​java.lang.String> getSuppressMap()