Package net.sourceforge.pmd.lang.ast
Class AstInfo<T extends RootNode>
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.AstInfo<T>
-
- Type Parameters:
T
- Type of root nodes
public final class AstInfo<T extends RootNode> extends Object
The output ofParser.parse(ParserTask)
.
-
-
Constructor Summary
Constructors Constructor Description AstInfo(Parser.ParserTask task, T rootNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LanguageProcessor
getLanguageProcessor()
Returns the language processor that parsed the tree.T
getRootNode()
Map<Integer,String>
getSuppressionComments()
Returns the map of line numbers to suppression / review comments.@NonNull TextDocument
getTextDocument()
Returns the text document that was parsed.AstInfo<T>
withSuppressMap(Map<Integer,String> map)
-
-
-
Constructor Detail
-
AstInfo
public AstInfo(Parser.ParserTask task, T rootNode)
-
-
Method Detail
-
getRootNode
public T getRootNode()
-
getTextDocument
public @NonNull TextDocument getTextDocument()
Returns the text document that was parsed. This has info like language version, etc.
-
getLanguageProcessor
public LanguageProcessor getLanguageProcessor()
Returns the language processor that parsed the tree.
-
getSuppressionComments
public Map<Integer,String> getSuppressionComments()
Returns the map of line numbers to suppression / review comments. Only single line comments are considered, that start with the configured "suppressMarker", which by default is "PMD". The text after the suppressMarker is used as a "review comment" and included in this map.This map is later used to determine, if a violation is being suppressed. It is suppressed, if the line of the violation is contained in this suppress map.
- Returns:
- map of the suppress lines with the corresponding review comments.
-
-