org.apache.velocity.runtime.directive
Class Evaluate

java.lang.Object
  extended by org.apache.velocity.runtime.directive.Directive
      extended by org.apache.velocity.runtime.directive.Evaluate
All Implemented Interfaces:
Cloneable, DirectiveConstants

public class Evaluate
extends Directive

Evaluates the macro argument as a Velocity string, using the existing context.

Since:
1.6
Version:
$Id: Evaluate.java 685685 2008-08-13 21:43:27Z nbubna $
Author:
Will Glass-Husain

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.directive.Directive
rsvc
 
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
 
Constructor Summary
Evaluate()
           
 
Method Summary
 String getName()
          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
getColumn, getLine, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Evaluate

public Evaluate()
Method Detail

getName

public String getName()
Return name of this directive.

Specified by:
getName in class Directive
Returns:
The name of this directive.

getType

public int getType()
Return type of this directive.

Specified by:
getType in class Directive
Returns:
The type of this directive.

init

public void init(RuntimeServices rs,
                 InternalContextAdapter context,
                 Node node)
          throws TemplateInitException
Initialize and check arguments.

Overrides:
init in class Directive
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 class Directive
Parameters:
context -
writer -
node -
Returns:
True if the directive rendered successfully.
Throws:
IOException
ResourceNotFoundException
ParseErrorException
MethodInvocationException


Copyright © 2000-2008 The Apache Software Foundation. All Rights Reserved.