org.xwiki.velocity.introspection
Class AbstractChainableUberspector

java.lang.Object
  extended by org.apache.velocity.util.introspection.UberspectImpl
      extended by org.xwiki.velocity.introspection.AbstractChainableUberspector
All Implemented Interfaces:
org.apache.velocity.util.introspection.Uberspect, org.apache.velocity.util.introspection.UberspectLoggable, ChainableUberspector
Direct Known Subclasses:
ChainingUberspector, DeprecatedCheckUberspector, MethodArgumentsUberspector

public abstract class AbstractChainableUberspector
extends org.apache.velocity.util.introspection.UberspectImpl
implements ChainableUberspector

Default implementation of a chainable uberspector that forwards all calls to the wrapped uberspector (when that is possible). It should be used as the base class for all chainable uberspectors.

Since:
1.5M1
Version:
$Id$
See Also:
ChainableUberspector

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.velocity.util.introspection.UberspectImpl
org.apache.velocity.util.introspection.UberspectImpl.VelGetterImpl, org.apache.velocity.util.introspection.UberspectImpl.VelMethodImpl, org.apache.velocity.util.introspection.UberspectImpl.VelSetterImpl
 
Field Summary
protected  org.apache.velocity.util.introspection.Uberspect inner
          The wrapped (decorated) uberspector.
 
Fields inherited from class org.apache.velocity.util.introspection.UberspectImpl
introspector, log
 
Constructor Summary
AbstractChainableUberspector()
           
 
Method Summary
 Iterator getIterator(Object obj, org.apache.velocity.util.introspection.Info i)
           
 org.apache.velocity.util.introspection.VelMethod getMethod(Object obj, String methodName, Object[] args, org.apache.velocity.util.introspection.Info i)
           
 org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(Object obj, String identifier, org.apache.velocity.util.introspection.Info i)
           
 org.apache.velocity.util.introspection.VelPropertySet getPropertySet(Object obj, String identifier, Object arg, org.apache.velocity.util.introspection.Info i)
           
 void init()
           
 void wrap(org.apache.velocity.util.introspection.Uberspect inner)
          Since uberspectors are dynamically enabled using a configuration string, we cannot simply call the constructors to pass the inner uberspector.
 
Methods inherited from class org.apache.velocity.util.introspection.UberspectImpl
setLog, setRuntimeLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inner

protected org.apache.velocity.util.introspection.Uberspect inner
The wrapped (decorated) uberspector.

Constructor Detail

AbstractChainableUberspector

public AbstractChainableUberspector()
Method Detail

wrap

public void wrap(org.apache.velocity.util.introspection.Uberspect inner)
Description copied from interface: ChainableUberspector
Since uberspectors are dynamically enabled using a configuration string, we cannot simply call the constructors to pass the inner uberspector. We can either instantiate uberspectors using reflection and passing the wrapped object to the constructor, or explicitely "wrap" the inner uberspector. The second method has several advantages, so it was chosen here:

Specified by:
wrap in interface ChainableUberspector
Parameters:
inner - The decorated uberspector.

init

public void init()
Specified by:
init in interface org.apache.velocity.util.introspection.Uberspect
Overrides:
init in class org.apache.velocity.util.introspection.UberspectImpl

getIterator

public Iterator getIterator(Object obj,
                            org.apache.velocity.util.introspection.Info i)
                     throws Exception
Specified by:
getIterator in interface org.apache.velocity.util.introspection.Uberspect
Overrides:
getIterator in class org.apache.velocity.util.introspection.UberspectImpl
Throws:
Exception

getMethod

public org.apache.velocity.util.introspection.VelMethod getMethod(Object obj,
                                                                  String methodName,
                                                                  Object[] args,
                                                                  org.apache.velocity.util.introspection.Info i)
                                                           throws Exception
Specified by:
getMethod in interface org.apache.velocity.util.introspection.Uberspect
Overrides:
getMethod in class org.apache.velocity.util.introspection.UberspectImpl
Throws:
Exception

getPropertyGet

public org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(Object obj,
                                                                            String identifier,
                                                                            org.apache.velocity.util.introspection.Info i)
                                                                     throws Exception
Specified by:
getPropertyGet in interface org.apache.velocity.util.introspection.Uberspect
Overrides:
getPropertyGet in class org.apache.velocity.util.introspection.UberspectImpl
Throws:
Exception

getPropertySet

public org.apache.velocity.util.introspection.VelPropertySet getPropertySet(Object obj,
                                                                            String identifier,
                                                                            Object arg,
                                                                            org.apache.velocity.util.introspection.Info i)
                                                                     throws Exception
Specified by:
getPropertySet in interface org.apache.velocity.util.introspection.Uberspect
Overrides:
getPropertySet in class org.apache.velocity.util.introspection.UberspectImpl
Throws:
Exception


Copyright © 2004-2012 XWiki. All Rights Reserved.