org.apache.velocity.runtime.directive

Class Literal

public class Literal extends Directive

A very simple directive that leverages the Node.literal() to grab the literal rendition of a node. We basically grab the literal value on init(), then repeatedly use that during render().

Version: $Id: Literal.java,v 1.7.4.1 2004/03/03 23:22:56 geirm Exp $

Author: Jason van Zyl

Field Summary
StringliteralText
Method Summary
StringgetName()
Return name of this directive.
intgetType()
Return type of this directive.
voidinit(RuntimeServices rs, InternalContextAdapter context, Node node)
Store the literal rendition of a node using the Node.literal().
booleanrender(InternalContextAdapter context, Writer writer, Node node)
Throw the literal rendition of the block between #literal()/#end into the writer.

Field Detail

literalText

String literalText

Method Detail

getName

public String getName()
Return name of this directive.

getType

public int getType()
Return type of this directive.

init

public void init(RuntimeServices rs, InternalContextAdapter context, Node node)
Store the literal rendition of a node using the Node.literal().

render

public boolean render(InternalContextAdapter context, Writer writer, Node node)
Throw the literal rendition of the block between #literal()/#end into the writer.
Copyright B) 2002 Apache Software Foundation. All Rights Reserved.