Test (Velocity 1.4 API)
Keywords: org.apache.velocity.test.misc.Test class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.8.1 2004/03/03 23:23:05 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, toString, wait, wait, wait`

Field Detail

### writerStack

    private static java.util.Stack writerStack

  Cache of writers

Constructor Detail

### Test

    public Test(java.lang.String templateFile,
                java.lang.String encoding)

Method Detail

### 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`
  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`
  Parameters:
    `lhs` - reference literal of left-hand-side of set statement
    `rhs` - 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`
  Throws:
    `java.lang.Exception`

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 Apache Software Foundation. All Rights Reserved.