public class ASTStringLiteral extends SimpleNode
Constructor and Description |
---|
ASTStringLiteral(int id) |
ASTStringLiteral(Parser p,
int id) |
Modifier and Type | Method and Description |
---|---|
void |
adjTokenLineNums(Node 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 |
evaluate(InternalContextAdapter context) |
Object |
init(InternalContextAdapter context,
Object data)
init : we don't have to do much.
|
boolean |
isConstant()
Check to see if this is an interpolated string.
|
Object |
jjtAccept(ParserVisitor visitor,
Object data) |
static String |
unescape(String string) |
Object |
value(InternalContextAdapter context)
renders the value of the string literal If the properties allow, and the
string literal contains a $ or a # the literal is rendered against the
context Otherwise, the stringlit is returned.
|
childrenAccept, cleanupParserAndTokens, dump, dump, dump, execute, getColumn, getFirstToken, getFirstTokenImage, getInfo, getLastToken, getLastTokenImage, getLine, getLocation, getParser, getRuntimeServices, getTemplate, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, saveTokenImages, setFirstToken, setInfo, setInvalid, toString, toString
public ASTStringLiteral(int id)
id
- public ASTStringLiteral(Parser p, int id)
p
- id
- public Object init(InternalContextAdapter context, Object data) throws TemplateInitException
init
in interface Node
init
in class SimpleNode
context
- data
- TemplateInitException
Node.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
public void adjTokenLineNums(Node node)
node
- public static String unescape(String string)
string
- public Object jjtAccept(ParserVisitor visitor, Object data)
jjtAccept
in interface Node
jjtAccept
in class SimpleNode
visitor
- data
- SimpleNode.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor,
java.lang.Object)
public boolean isConstant()
public Object value(InternalContextAdapter context)
value
in interface Node
value
in class SimpleNode
context
- Node.value(org.apache.velocity.context.InternalContextAdapter)
public boolean evaluate(InternalContextAdapter context)
evaluate
in interface Node
evaluate
in class SimpleNode
SimpleNode.evaluate(org.apache.velocity.context.InternalContextAdapter)
Copyright © 2000–2021 The Apache Software Foundation. All rights reserved.