org.apache.velocity.test.misc
Class Test
java.lang.Object
|
+--org.apache.velocity.test.misc.Test
- All Implemented Interfaces:
- EventHandler, MethodExceptionEventHandler, NullSetEventHandler, ReferenceInsertionEventHandler
- public class Test
- extends java.lang.Object
- implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler
This class the testbed for Velocity. It is used to
test all the directives support by Velocity.
- Version:
- $Id: Test.java,v 1.34 2001/10/25 09:19:42 geirm Exp $
- Author:
- Jason van Zyl, Geir Magnusson Jr.
Field Summary |
private static java.util.Stack |
writerStack
Cache of writers |
Constructor Summary |
Test(java.lang.String templateFile,
java.lang.String encoding)
|
Method Summary |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
|
java.lang.Object |
referenceInsert(java.lang.String reference,
java.lang.Object value)
A call-back which is executed during Velocity merge before a
reference value is inserted into the output stream. |
boolean |
shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
Called when the RHS of a #set() is null, which will result
in a null LHS. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
writerStack
private static java.util.Stack writerStack
- Cache of writers
Test
public Test(java.lang.String templateFile,
java.lang.String encoding)
referenceInsert
public java.lang.Object referenceInsert(java.lang.String reference,
java.lang.Object value)
- Description copied from interface:
ReferenceInsertionEventHandler
- A call-back which is executed during Velocity merge before a
reference value is inserted into the output stream.
- Specified by:
referenceInsert
in interface ReferenceInsertionEventHandler
- Following copied from interface:
org.apache.velocity.app.event.ReferenceInsertionEventHandler
- Parameters:
reference
- Reference from template about to be inserted.value
- Value about to be inserted (after its
toString()
method is called).- Returns:
- Object on which
toString()
should be
called for output.
shouldLogOnNullSet
public boolean shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
- Description copied from interface:
NullSetEventHandler
- Called when the RHS of a #set() is null, which will result
in a null LHS.
- Specified by:
shouldLogOnNullSet
in interface NullSetEventHandler
- Following copied from interface:
org.apache.velocity.app.event.NullSetEventHandler
- Parameters:
lhs
- reference literal of left-hand-side of set statementrhs
- reference literal of right-hand-side of set statement- Returns:
- true if log message should be written, false otherwise
methodException
public java.lang.Object methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
throws java.lang.Exception
- Specified by:
methodException
in interface MethodExceptionEventHandler
main
public static void main(java.lang.String[] args)
Copyright © 2003 Apache Software Foundation. All Rights Reserved.