Package net.sourceforge.pmd.lang.ast
Interface TextAvailableNode
- All Superinterfaces:
Node,Reportable
- All Known Subinterfaces:
JjtreeNode<N>
- All Known Implementing Classes:
AbstractJjtreeNode
Refinement of
Node for nodes that can provide the underlying
source text.- Since:
- 7.0.0
-
Field Summary
Fields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptiondefault CharsReturns the original source code underlying this node, before any escapes have been translated.default CharsgetText()Returns the source code underlying this node, after any escapes have been translated.Returns the exact region of text delimiting the node in the underlying text document.Methods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, ancestors, ancestorsOrSelf, asStream, children, children, compareLocation, descendants, descendants, descendantsOrSelf, firstChild, getAstInfo, getBeginColumn, getBeginLine, getChild, getEndColumn, getEndLine, getFirstChild, getImage, getIndexInParent, getLanguageVersion, getLastChild, getNextSibling, getNumChildren, getParent, getPreviousSibling, getReportLocation, getRoot, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundary
-
Method Details
-
getTextRegion
TextRegion getTextRegion()Returns the exact region of text delimiting the node in the underlying text document. Note thatNode.getReportLocation()does not need to match this region.Node.getReportLocation()can be scoped down to a specific token, eg the class identifier. This region uses the translated coordinate system, ie the coordinate system ofNode.getTextDocument().- Specified by:
getTextRegionin interfaceNode
-
getOriginalText
Returns the original source code underlying this node, before any escapes have been translated. In particular, for aRootNode, returns the whole text of the file.- See Also:
-
getText
Returns the source code underlying this node, after any escapes have been translated. In particular, for aRootNode, returns the whole text of the file.- See Also:
-