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 $

Method Summary
 Iterator getIterator(Object obj, Info info)
          To support iteratives - #foreach().
 VelMethod getMethod(Object obj, String method, Object[] args, Info info)
          Returns a general method, corresponding to $foo.bar( $woogie ).
 VelPropertyGet getPropertyGet(Object obj, String identifier, Info info)
          Property getter - returns VelPropertyGet appropos for #set($foo = $bar.woogie).
 VelPropertySet getPropertySet(Object obj, String identifier, 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

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

Throws:
Exception - on any error.

getIterator

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

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

getMethod

public VelMethod getMethod(Object obj,
                           String method,
                           Object[] args,
                           Info info)
                    throws 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:
Exception - on any error.

getPropertyGet

public VelPropertyGet getPropertyGet(Object obj,
                                     String identifier,
                                     Info info)
                              throws 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:
Exception - on any error.

getPropertySet

public VelPropertySet getPropertySet(Object obj,
                                     String identifier,
                                     Object arg,
                                     Info info)
                              throws 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:
Exception - on any error.


Copyright © 2003-2006 The Apache Software Foundation. All Rights Reserved.