Class Literal
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Literal
- All Implemented Interfaces:
Cloneable
,DirectiveConstants
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 $
- Author:
- Jason van Zyl
-
Field Summary
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
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
Deprecated.Since there is no processing of content, there is never a need for an internal scope.boolean
render
(InternalContextAdapter context, 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
-
Constructor Details
-
Literal
public Literal()Deprecated.
-
-
Method Details
-
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
Deprecated.Throw the literal rendition of the block between #literal()/#end into the writer.- Specified by:
render
in classDirective
- Parameters:
context
-writer
-node
-- Returns:
- True if the directive rendered successfully.
- Throws:
IOException
-