Class Evaluate
- java.lang.Object
-
- org.apache.velocity.runtime.directive.Directive
-
- org.apache.velocity.runtime.directive.Evaluate
-
- All Implemented Interfaces:
java.lang.Cloneable,DirectiveConstants
public class Evaluate extends Directive
Evaluates the directive argument as a VTL string, using the existing context.- Since:
- 1.6
- Version:
- $Id: Evaluate.java 898032 2010-01-11 19:51:03Z nbubna $
-
-
Field Summary
-
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
-
-
Constructor Summary
Constructors Constructor Description Evaluate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Return name of this directive.intgetType()Return type of this directive.voidinit(RuntimeServices rs, InternalContextAdapter context, Node node)Initialize and check arguments.booleanrender(InternalContextAdapter context, java.io.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
getColumn, getLine, getScopeName, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
-
-
-
-
Method Detail
-
getName
public java.lang.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) throws TemplateInitException
Initialize and check arguments.- Overrides:
initin classDirective- Parameters:
rs-context-node-- Throws:
TemplateInitException
-
render
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException
Evaluate the argument, convert to a String, and evaluate again (with the same context).- Specified by:
renderin classDirective- Parameters:
context-writer-node-- Returns:
- True if the directive rendered successfully.
- Throws:
java.io.IOExceptionResourceNotFoundExceptionParseErrorExceptionMethodInvocationException
-
-