NVelocity.App.Events
Class EventCartridge

'Package' of event handlers... *

Constructor Summary
EventCartridge()
        Initializes a new instance of the EventCartridge class.

Method Summary
bool addEventHandler(NVelocity.App.Events.EventHandler ev)
         Adds an event handler(s) to the Cartridge. This method will find all possible event handler interfaces supported by the passed in object. *
bool attachToContext(NVelocity.Context.IContext context)
         Attached the EventCartridge to the context * Final because not something one should mess with lightly :) *
object methodException(System.Type claz, string method, System.Exception e)
         Implementation of MethodExceptionEventHandler method
methodException()
. * Called during Velocity merge if a reference is null *
object referenceInsert(string reference, object value_Renamed)
         Implementation of ReferenceInsertionEventHandler method
referenceInsert()
. * Called during Velocity merge before a reference value will be inserted into the output stream. *
bool removeEventHandler(NVelocity.App.Events.EventHandler ev)
         Removes an event handler(s) from the Cartridge. This method will find all possible event handler interfaces supported by the passed in object and remove them. *
bool shouldLogOnNullSet(string lhs, string rhs)
         Implementation of NullSetEventHandler method
shouldLogOnNullSet()
. * Called during Velocity merge to determine if when a #set() results in a null assignment, a warning is logged. *

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

EventCartridge

public EventCartridge()

Initializes a new instance of the EventCartridge class.

Method Detail

addEventHandler

public bool addEventHandler(NVelocity.App.Events.EventHandler ev)

Adds an event handler(s) to the Cartridge. This method will find all possible event handler interfaces supported by the passed in object. *

Parameters:
ev - object impementing a valid EventHandler-derived interface
Returns:
true if a supported interface, false otherwise or if null

attachToContext

public bool attachToContext(NVelocity.Context.IContext context)

Attached the EventCartridge to the context * Final because not something one should mess with lightly :) *

Parameters:
context - context to attach to
Returns:
true if successful, false otherwise

methodException

public object methodException(System.Type claz,
                              string method,
                              System.Exception e)

Implementation of MethodExceptionEventHandler method

methodException()
. * Called during Velocity merge if a reference is null *

Parameters:
claz - Class that is causing the exception
method - method called that causes the exception
e - Exception thrown by the method
Returns:
Object to return as method result @throws exception to be wrapped and propogated to app

referenceInsert

public object referenceInsert(string reference,
                              object value_Renamed)

Implementation of ReferenceInsertionEventHandler method

referenceInsert()
. * Called during Velocity merge before a reference value will be inserted into the output stream. *

Parameters:
reference - reference from template about to be inserted
value - value about to be inserted (after toString() )
Returns:
Object on which toString() should be called for output.

removeEventHandler

public bool removeEventHandler(NVelocity.App.Events.EventHandler ev)

Removes an event handler(s) from the Cartridge. This method will find all possible event handler interfaces supported by the passed in object and remove them. *

Parameters:
ev - object impementing a valid EventHandler-derived interface
Returns:
true if a supported interface, false otherwise or if null

shouldLogOnNullSet

public bool shouldLogOnNullSet(string lhs,
                               string rhs)

Implementation of NullSetEventHandler method

shouldLogOnNullSet()
. * Called during Velocity merge to determine if when a #set() results in a null assignment, a warning is logged. *

Parameters:
reference - reference from template about to be inserted
Returns:
true if to be logged, false otherwise