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

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.ASTStringLiteral
All Implemented Interfaces:
Node, VmNode

public class ASTStringLiteral
extends AbstractVmNode

ASTStringLiteral support. Will interpolate!

Version:
$Id: ASTStringLiteral.java 705297 2008-10-16 17:59:24Z nbubna $
Author:
Geir Magnusson Jr., Jason van Zyl

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
ASTStringLiteral(int id)
           
ASTStringLiteral(VmParser p, int id)
           
 
Method Summary
 void adjTokenLineNums(AbstractVmNode node)
          Adjust all the line and column numbers that comprise a node so that they are corrected for the string literals position within the template file.
 boolean isConstant()
          Check to see if this is an interpolated string.
 Object jjtAccept(VmParserVisitor visitor, Object data)
          Accept the visitor.
static String unescape(String string)
           
 
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, 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

ASTStringLiteral

public ASTStringLiteral(int id)
Parameters:
id -

ASTStringLiteral

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

adjTokenLineNums

public void adjTokenLineNums(AbstractVmNode node)
Adjust all the line and column numbers that comprise a node so that they are corrected for the string literals position within the template file. This is neccessary if an exception is thrown while processing the node so that the line and column position reported reflects the error position within the template and not just relative to the error position within the string literal.


unescape

public static String unescape(String string)
Since:
1.6

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)

isConstant

public boolean isConstant()
Check to see if this is an interpolated string.

Returns:
true if this is constant (not an interpolated string)
Since:
1.6


Copyright © 2002–2015 InfoEther. All rights reserved.