Class ASTReference

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.ast.Node, VmNode

    public class ASTReference
    extends AbstractVmNode
    This class is responsible for handling the references in VTL ($foo). Please look at the Parser.jjt file which is what controls the generation of this class.
    Version:
    $Id: ASTReference.java 806597 2009-08-21 15:21:44Z nbubna $
    Author:
    Jason van Zyl, Geir Magnusson Jr., Christoph Reck, Kent Johnson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean strictRef
      Deprecated.
      for removal with PMD 7.0.0
      boolean toStringNullCheck
      Deprecated.
      for removal with PMD 7.0.0
      • 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 Deprecated Methods 
      Modifier and Type Method Description
      String getRootString()
      Returns the 'root string', the reference key
      Object jjtAccept​(VmParserVisitor visitor, Object data)
      Accept the visitor.
      String literal()
      Override of the SimpleNode method literal() Returns the literal representation of the node.
      void setLiteral​(String literal)
      Deprecated.
      • Methods inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode

        children, getChild, getParent
      • Methods inherited from class net.sourceforge.pmd.lang.ast.AbstractNode

        appendElement, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getIndexInParent, getNthParent, getNumChildren, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfAnyType, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetFirstToken, jjtGetId, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData, testingOnlySetBeginColumn, testingOnlySetBeginLine, testingOnlySetEndColumn, testingOnlySetEndLine, toString
      • Methods inherited from interface net.sourceforge.pmd.lang.ast.Node

        findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getIndexInParent, getNthParent, getNumChildren, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData
    • Field Detail

      • strictRef

        @Deprecated
        public boolean strictRef
        Deprecated.
        for removal with PMD 7.0.0
        Indicates if we are running in strict reference mode.
      • toStringNullCheck

        @Deprecated
        public boolean toStringNullCheck
        Deprecated.
        for removal with PMD 7.0.0
        Indicates if toString() should be called during condition evaluation just to ensure it does not return null. Check is unnecessary if all toString() implementations are known to have non-null return values. Disabling the check will give a performance improval since toString() may be a complex operation on large objects.
    • Constructor Detail

      • ASTReference

        @InternalApi
        @Deprecated
        public ASTReference​(int id)
        Deprecated.
      • ASTReference

        @InternalApi
        @Deprecated
        public ASTReference​(VmParser p,
                            int id)
        Deprecated.
    • Method Detail

      • getRootString

        public String getRootString()
        Returns the 'root string', the reference key
        Returns:
        the root string.
      • setLiteral

        @InternalApi
        @Deprecated
        public void setLiteral​(String literal)
        Deprecated.
        Routine to allow the literal representation to be externally overridden. Used now in the VM system to override a reference in a VM tree with the literal of the calling arg to make it work nicely when calling arg is null. It seems a bit much, but does keep things consistant. Note, you can only set the literal once...
        Parameters:
        literal - String to render to when null
      • literal

        public String literal()
        Override of the SimpleNode method literal() Returns the literal representation of the node. Should be something like $<token>.
        Overrides:
        literal in class AbstractVmNode
        Returns:
        A literal string.