Class Evaluate
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Evaluate
- All Implemented Interfaces:
Cloneable
,DirectiveConstants
Evaluates the directive argument as a VTL string, using the existing
context.
- Since:
- 1.6
- Version:
- $Id$
- Author:
- Will Glass-Husain
-
Field Summary
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Return name of this directive.int
getType()
Return type of this directive.void
init
(RuntimeServices rs, InternalContextAdapter context, Node node) Initialize and check arguments.boolean
render
(InternalContextAdapter context, Writer writer, Node node) Evaluate the argument, convert to a String, and evaluate again (with the same context).Methods inherited from class org.apache.velocity.runtime.directive.Directive
checkArgs, getColumn, getLine, getScopeName, getTemplate, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
-
Constructor Details
-
Evaluate
public Evaluate()
-
-
Method Details
-
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) throws TemplateInitException Initialize and check arguments.- Overrides:
init
in classDirective
- Parameters:
rs
-context
-node
-- Throws:
TemplateInitException
-
render
public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException Evaluate the argument, convert to a String, and evaluate again (with the same context).- Specified by:
render
in classDirective
- Parameters:
context
-writer
-node
-- Returns:
- True if the directive rendered successfully.
- Throws:
IOException
ResourceNotFoundException
ParseErrorException
MethodInvocationException
-