Class Literal
- java.lang.Object
-
- org.apache.velocity.runtime.directive.Directive
-
- org.apache.velocity.runtime.directive.Literal
-
- All Implemented Interfaces:
java.lang.Cloneable
,DirectiveConstants
public class Literal extends Directive
Deprecated.Use the #[[unparsed content]]# syntax instead.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(). This is deprecated and will be removed in Velocity 2.0; please use #[[unparsed content]]# instead.- Version:
- $Id: Literal.java 746438 2009-02-21 05:41:24Z nbubna $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
literalText
Deprecated.-
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
-
-
Constructor Summary
Constructors Constructor Description Literal()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getName()
Deprecated.Return name of this directive.int
getType()
Deprecated.Return type of this directive.void
init(RuntimeServices rs, InternalContextAdapter context, Node node)
Deprecated.Store the literal rendition of a node using the Node.literal().boolean
isScopeProvided()
Deprecated.Since there is no processing of content, there is never a need for an internal scope.boolean
render(InternalContextAdapter context, java.io.Writer writer, Node node)
Deprecated.Throw the literal rendition of the block between #literal()/#end into the writer.-
Methods inherited from class org.apache.velocity.runtime.directive.Directive
getColumn, getLine, getScopeName, getTemplateName, makeScope, postRender, preRender, setLocation, setLocation
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Deprecated.Return name of this directive.
-
getType
public int getType()
Deprecated.Return type of this directive.
-
isScopeProvided
public boolean isScopeProvided()
Deprecated.Since there is no processing of content, there is never a need for an internal scope.- Overrides:
isScopeProvided
in classDirective
- Returns:
- true if there will be a scope control injected into the context when rendering this directive.
-
init
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException
Deprecated.Store the literal rendition of a node using the Node.literal().- Overrides:
init
in classDirective
- Parameters:
rs
-context
-node
-- Throws:
TemplateInitException
-
render
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException
Deprecated.Throw the literal rendition of the block between #literal()/#end into the writer.
-
-