Package net.sourceforge.pmd.lang
Class PlainTextLanguage.PlainTextFile
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.AbstractNode
-
- net.sourceforge.pmd.lang.PlainTextLanguage.PlainTextFile
-
- Enclosing class:
- PlainTextLanguage
public static final class PlainTextLanguage.PlainTextFile extends AbstractNode implements RootNode
The only node produced by the parser ofPlainTextLanguage
.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.lang.ast.AbstractNode
beginColumn, beginLine, childIndex, children, endColumn, endLine, firstToken, id, lastToken, parent
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getImage()
Returns a string token, usually filled-in by the parser, which describes some textual characteristic of this node.String
getXPathNodeName()
Gets the name of the node that is used to match it with XPath queries.void
remove()
Remove the current node from its parent.void
removeChildAtIndex(int childIndex)
This method tells the node to remove the child node at the given index from the node's list of children, if any; if not, no changes are done.void
setImage(String image)
String
toString()
-
Methods inherited from class net.sourceforge.pmd.lang.ast.AbstractNode
appendElement, children, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getChild, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getIndexInParent, getNthParent, getNumChildren, getParent, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfAnyType, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetFirstToken, jjtGetId, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, setDataFlowNode, setUserData, testingOnlySetBeginColumn, testingOnlySetBeginLine, testingOnlySetEndColumn, testingOnlySetEndLine
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.Node
children, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getChild, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getIndexInParent, getNthParent, getNumChildren, getParent, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetParent, setDataFlowNode, setUserData
-
-
-
-
Method Detail
-
getXPathNodeName
public String getXPathNodeName()
Description copied from class:AbstractNode
Gets the name of the node that is used to match it with XPath queries.This default implementation adds compatibility with the previous way to get the xpath node name, which used
Object.toString()
.Please override it. It will be removed in version 7.0.0.
- Specified by:
getXPathNodeName
in interfaceNode
- Overrides:
getXPathNodeName
in classAbstractNode
- Returns:
- The XPath node name
-
getImage
public String getImage()
Description copied from interface:Node
Returns a string token, usually filled-in by the parser, which describes some textual characteristic of this node. This is usually an identifier, but you should check that using the Designer. On most nodes though, this method returnsnull
.- Specified by:
getImage
in interfaceNode
- Overrides:
getImage
in classAbstractNode
-
setImage
public void setImage(String image)
- Specified by:
setImage
in interfaceNode
- Overrides:
setImage
in classAbstractNode
-
remove
public void remove()
Description copied from interface:Node
Remove the current node from its parent.- Specified by:
remove
in interfaceNode
- Overrides:
remove
in classAbstractNode
-
removeChildAtIndex
public void removeChildAtIndex(int childIndex)
Description copied from interface:Node
This method tells the node to remove the child node at the given index from the node's list of children, if any; if not, no changes are done.- Specified by:
removeChildAtIndex
in interfaceNode
- Overrides:
removeChildAtIndex
in classAbstractNode
- Parameters:
childIndex
- The index of the child to be removed
-
toString
public String toString()
- Overrides:
toString
in classAbstractNode
-
-