net.sourceforge.pmd.lang.vm.ast
Class ASTDirective

java.lang.Object
  extended by net.sourceforge.pmd.lang.ast.AbstractNode
      extended by net.sourceforge.pmd.lang.vm.ast.AbstractVmNode
          extended by net.sourceforge.pmd.lang.vm.ast.ASTDirective
All Implemented Interfaces:
Node, VmNode

public class ASTDirective
extends AbstractVmNode

This class is responsible for handling the pluggable directives in VTL. For example : #foreach() Please look at the Parser.jjt file which is what controls the generation of this class.

Version:
$Id: ASTDirective.java 724825 2008-12-09 18:56:06Z nbubna $
Author:
Jason van Zyl, Geir Magnusson Jr., Kasper Nielsen

Field Summary
 
Fields inherited from class net.sourceforge.pmd.lang.vm.ast.AbstractVmNode
first, info, invalid, last, parser, state, templateName
 
Fields inherited from class net.sourceforge.pmd.lang.ast.AbstractNode
beginColumn, beginLine, childIndex, children, endColumn, endLine, id, parent
 
Constructor Summary
ASTDirective(int id)
           
ASTDirective(VmParser p, int id)
           
 
Method Summary
 String getDirectiveName()
          Gets the name of this directive.
 Object jjtAccept(VmParserVisitor visitor, Object data)
          Accept the visitor.
 void setDirectiveName(String str)
          Sets the directive name.
 String toString()
          Subclasses should implement this method to return a name usable with XPathRule for evaluating Element Names.
 
Methods inherited from class net.sourceforge.pmd.lang.vm.ast.AbstractVmNode
childrenAccept, dump, getColumn, getFirstToken, getInfo, getLastToken, getLine, getTemplateName, getType, isInvalid, jjtClose, jjtOpen, literal, setFirstToken, setInfo, setInvalid, toString
 
Methods inherited from class net.sourceforge.pmd.lang.ast.AbstractNode
appendElement, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetParent, setDataFlowNode, setImage, setUserData, testingOnly__setBeginColumn, testingOnly__setBeginLine, testingOnly__setEndColumn, testingOnly__setEndLine
 
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
findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetParent, setDataFlowNode, setImage, setUserData
 

Constructor Detail

ASTDirective

public ASTDirective(int id)
Parameters:
id -

ASTDirective

public ASTDirective(VmParser p,
                    int id)
Parameters:
p -
id -
Method Detail

jjtAccept

public Object jjtAccept(VmParserVisitor visitor,
                        Object data)
Description copied from interface: VmNode
Accept the visitor. *

Specified by:
jjtAccept in interface VmNode
Overrides:
jjtAccept in class AbstractVmNode
See Also:
org.apache.velocity.runtime.parser.node.SimpleNode#jjtAccept(org.apache.velocity.runtime.parser.node.VmParserVisitor, java.lang.Object)

setDirectiveName

public void setDirectiveName(String str)
Sets the directive name. Used by the parser. This keeps us from having to dig it out of the token stream and gives the parse the change to override.

Parameters:
str -

getDirectiveName

public String getDirectiveName()
Gets the name of this directive.

Returns:
The name of this directive.

toString

public String toString()
Description copied from class: AbstractNode
Subclasses should implement this method to return a name usable with XPathRule for evaluating Element Names.

Overrides:
toString in class AbstractVmNode
Since:
1.5


Copyright © 2002–2015 InfoEther. All rights reserved.