org.apache.velocity.test.misc

Class Test

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.8.1 2004/03/03 23:23:05 geirm Exp $
Authors:
Jason van Zyl
Geir Magnusson Jr.

Field Summary

private static Stack
writerStack
Cache of writers

Constructor Summary

Test(String templateFile, String encoding)

Method Summary

static void
main(String[] args)
Object
methodException(Class claz, String method, Exception e)
Object
referenceInsert(String reference, Object value)
A call-back which is executed during Velocity merge before a reference value is inserted into the output stream.
boolean
shouldLogOnNullSet(String lhs, String rhs)

Field Details

writerStack

private static Stack writerStack
Cache of writers

Constructor Details

Test

public Test(String templateFile,
            String encoding)

Method Details

main

public static void main(String[] args)

methodException

public Object methodException(Class claz,
                              String method,
                              Exception e)
            throws Exception
Specified by:
methodException in interface MethodExceptionEventHandler

referenceInsert

public Object referenceInsert(String reference,
                              Object value)
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
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(String lhs,
                                  String rhs)
Specified by:
shouldLogOnNullSet in interface NullSetEventHandler

Copyright B) 2002 Apache Software Foundation. All Rights Reserved.