org.apache.commons.jexl.util.introspection
Interface Uberspect

All Known Implementing Classes:
UberspectImpl

public interface Uberspect

'Federated' introspection/reflection interface to allow the introspection behavior in Velocity to be customized.

Since:
1.0
Version:
$Id: Uberspect.java 398498 2006-05-01 01:48:57Z dion $
Author:
Geir Magusson Jr.

Method Summary
 java.util.Iterator getIterator(java.lang.Object obj, Info info)
          To support iteratives - #foreach().
 VelMethod getMethod(java.lang.Object obj, java.lang.String method, java.lang.Object[] args, Info info)
          Returns a general method, corresponding to $foo.bar( $woogie ).
 VelPropertyGet getPropertyGet(java.lang.Object obj, java.lang.String identifier, Info info)
          Property getter - returns VelPropertyGet appropos for #set($foo = $bar.woogie).
 VelPropertySet getPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info info)
          Property setter - returns VelPropertySet appropos for #set($foo.bar = "geir").
 void init()
          Initializer - will be called before use.
 

Method Detail

init

void init()
          throws java.lang.Exception
Initializer - will be called before use.

Throws:
java.lang.Exception - on any error.

getIterator

java.util.Iterator getIterator(java.lang.Object obj,
                               Info info)
                               throws java.lang.Exception
To support iteratives - #foreach().

Parameters:
info - template info.
obj - to get the iterator for.
Returns:
an iterator over obj.
Throws:
java.lang.Exception - on any error.

getMethod

VelMethod getMethod(java.lang.Object obj,
                    java.lang.String method,
                    java.lang.Object[] args,
                    Info info)
                    throws java.lang.Exception
Returns a general method, corresponding to $foo.bar( $woogie ).

Parameters:
obj - the object
method - the method name
args - method arguments
info - template info
Returns:
a VelMethod.
Throws:
java.lang.Exception - on any error.

getPropertyGet

VelPropertyGet getPropertyGet(java.lang.Object obj,
                              java.lang.String identifier,
                              Info info)
                              throws java.lang.Exception
Property getter - returns VelPropertyGet appropos for #set($foo = $bar.woogie).

Parameters:
obj - the object to get the property from.
identifier - property name
info - template info
Returns:
a VelPropertyGet.
Throws:
java.lang.Exception - on any error.

getPropertySet

VelPropertySet getPropertySet(java.lang.Object obj,
                              java.lang.String identifier,
                              java.lang.Object arg,
                              Info info)
                              throws java.lang.Exception
Property setter - returns VelPropertySet appropos for #set($foo.bar = "geir").

Parameters:
obj - the object to get the property from.
identifier - property name
arg - value to set.
info - template info
Returns:
a VelPropertySet.
Throws:
java.lang.Exception - on any error.