org.apache.velocity.runtime.parser.node

Class ASTStringLiteral

Implemented Interfaces:
Node

public class ASTStringLiteral
extends SimpleNode

ASTStringLiteral support. Will interpolate!

Version:
$Id: ASTStringLiteral.java,v 1.16 2002/02/28 05:06:08 geirm Exp $

Authors:
Geir Magnusson Jr.
Jason van Zyl

Nested Class Summary

Field Summary

private String
image
private boolean
interpolate
private String
interpolateimage
private SimpleNode
nodeTree

Fields inherited from class org.apache.velocity.runtime.parser.node.SimpleNode

children, first, last, id, info, invalid, parent, parser, rsvc, state

Constructor Summary

ASTStringLiteral(int id)
ASTStringLiteral(Parser p, int id)

Method Summary

Object
init(InternalContextAdapter context, Object data)
init : we don't have to do much.
Object
jjtAccept(ParserVisitor visitor, Object data)
Accept the visitor.
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.

Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode

childrenAccept, dump, evaluate, execute, getColumn, getFirstToken, getInfo, getLastToken, getLine, getType, init, isInvalid, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, setFirstToken, setInfo, setInvalid, toString, value

Field Details

image

private String image


interpolate

private boolean interpolate


interpolateimage

private String interpolateimage


nodeTree

private SimpleNode nodeTree

Constructor Details

ASTStringLiteral

public ASTStringLiteral(int id)


ASTStringLiteral

public ASTStringLiteral(Parser p,
                        int id)

Method Details

init

public Object init(InternalContextAdapter context,
                   Object data)
            throws Exception
init : we don't have to do much. Init the tree (there shouldn't be one) and then see if interpolation is turned on.
Specified by:
init in interface Node
Overrides:
init in interface SimpleNode


jjtAccept

public Object jjtAccept(ParserVisitor visitor,
                        Object data)
Accept the visitor. *
Specified by:
jjtAccept in interface Node
Overrides:
jjtAccept in interface SimpleNode


value

public 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.
Specified by:
value in interface Node
Overrides:
value in interface SimpleNode


Copyright © 2003 Apache Software Foundation. All Rights Reserved.