| org.apache.velocity.app.event.InvalidReferenceEventHandler
All known Subclasses: org.apache.velocity.app.event.implement.ReportInvalidReferences,
InvalidReferenceEventHandler | public interface InvalidReferenceEventHandler extends EventHandler(Code) | | Event handler called when an invalid reference is encountered. Allows
the application to report errors or substitute return values. May be chained
in sequence; the behavior will differ per method.
This feature should be regarded as experimental.
author: Will Glass-Husain version: $Id: InvalidReferenceEventHandler.java 470256 2006-11-02 07:20:36Z wglass $ |
Method Summary | |
public Object | invalidGetMethod(Context context, String reference, Object object, String property, Info info) Called when object is null or there is no getter for the given
property. | public Object | invalidMethod(Context context, String reference, Object object, String method, Info info) Called when object is null or the given method does not exist.
invalidMethod() will be called in sequence for each link in
the chain until the first non-null value is returned. | public boolean | invalidSetMethod(Context context, String leftreference, String rightreference, Info info) Called when object is null or there is no setter for the given
property. |
invalidGetMethod | public Object invalidGetMethod(Context context, String reference, Object object, String property, Info info)(Code) | | Called when object is null or there is no getter for the given
property. Also called for invalid references without properties.
invalidGetMethod() will be called in sequence for
each link in the chain until the first non-null value is
returned.
Parameters: context - the context when the reference was found invalid Parameters: reference - string with complete invalid reference Parameters: object - the object referred to, or null if not found Parameters: property - the property name from the reference Parameters: info - contains template, line, column details substitute return value for missing reference, or null if no substitute |
invalidMethod | public Object invalidMethod(Context context, String reference, Object object, String method, Info info)(Code) | | Called when object is null or the given method does not exist.
invalidMethod() will be called in sequence for each link in
the chain until the first non-null value is returned.
Parameters: context - the context when the reference was found invalid Parameters: reference - string with complete invalid reference Parameters: object - the object referred to, or null if not found Parameters: method - the name of the (non-existent) method Parameters: info - contains template, line, column details substitute return value for missing reference, or null if no substitute |
invalidSetMethod | public boolean invalidSetMethod(Context context, String leftreference, String rightreference, Info info)(Code) | | Called when object is null or there is no setter for the given
property. invalidSetMethod() will be called in sequence for
each link in the chain until a true value is returned. It's
recommended that false be returned as a default to allow
for easy chaining.
Parameters: context - the context when the reference was found invalid Parameters: leftreference - left reference being assigned to Parameters: rightreference - invalid reference on the right Parameters: info - contains info on template, line, col if true then stop calling invalidSetMethod along the chain. |
|
|