Class LinkingUberspector
- java.lang.Object
-
- org.apache.velocity.util.introspection.UberspectImpl
-
- org.apache.velocity.util.introspection.AbstractChainableUberspector
-
- org.apache.velocity.util.introspection.LinkingUberspector
-
- All Implemented Interfaces:
ChainableUberspector
,Uberspect
,RuntimeServicesAware
public class LinkingUberspector extends AbstractChainableUberspector
When the introspector.uberspect.class configuration property contains several uberspector class names, it means those uberspectors will be chained. When an uberspector in the list other than the leftmost does not implement ChainableUberspector, then this utility class is used to provide a basic default chaining where the first non-null result is kept for each introspection call.
- Since:
- 1.6
- Version:
- $Id: LinkingUberspector.java 10959 2008-07-01 00:12:29Z sdumitriu $
- See Also:
ChainableUberspector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.velocity.util.introspection.UberspectImpl
UberspectImpl.VelGetterImpl, UberspectImpl.VelMethodImpl, UberspectImpl.VelSetterImpl
-
-
Field Summary
-
Fields inherited from class org.apache.velocity.util.introspection.AbstractChainableUberspector
inner
-
Fields inherited from class org.apache.velocity.util.introspection.UberspectImpl
conversionHandler, introspector, log, rsvc
-
-
Constructor Summary
Constructors Constructor Description LinkingUberspector(Uberspect left, Uberspect right)
Constructor that takes the two uberspectors to link
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator
getIterator(Object obj, Info i)
To support iterative objects used in a#foreach()
loop.VelMethod
getMethod(Object obj, String methodName, Object[] args, Info i)
MethodVelPropertyGet
getPropertyGet(Object obj, String identifier, Info i)
Property getterVelPropertySet
getPropertySet(Object obj, String identifier, Object arg, Info i)
Property settervoid
init()
init - the chainable uberspector is responsible for the initialization of the wrapped uberspector-
Methods inherited from class org.apache.velocity.util.introspection.AbstractChainableUberspector
wrap
-
Methods inherited from class org.apache.velocity.util.introspection.UberspectImpl
getConversionHandler, setLog, setRuntimeServices
-
-
-
-
Method Detail
-
init
public void init()
init - the chainable uberspector is responsible for the initialization of the wrapped uberspectorInit both wrapped uberspectors
- Specified by:
init
in interfaceUberspect
- Overrides:
init
in classAbstractChainableUberspector
- See Also:
Uberspect.init()
-
getIterator
public Iterator getIterator(Object obj, Info i)
To support iterative objects used in a#foreach()
loop.- Specified by:
getIterator
in interfaceUberspect
- Overrides:
getIterator
in classAbstractChainableUberspector
- Parameters:
obj
- The iterative object.i
- Info about the object's location.- Returns:
- An
Iterator
object. - See Also:
Uberspect.getIterator(java.lang.Object, org.apache.velocity.util.introspection.Info)
-
getMethod
public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i)
Method- Specified by:
getMethod
in interfaceUberspect
- Overrides:
getMethod
in classAbstractChainableUberspector
- Returns:
- A Velocity Method.
- See Also:
Uberspect.getMethod(java.lang.Object, java.lang.String, java.lang.Object[], org.apache.velocity.util.introspection.Info)
-
getPropertyGet
public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i)
Property getter- Specified by:
getPropertyGet
in interfaceUberspect
- Overrides:
getPropertyGet
in classAbstractChainableUberspector
- Returns:
- A Velocity Getter Method.
- See Also:
Uberspect.getPropertyGet(java.lang.Object, java.lang.String, org.apache.velocity.util.introspection.Info)
-
getPropertySet
public VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info i)
Property setter- Specified by:
getPropertySet
in interfaceUberspect
- Overrides:
getPropertySet
in classAbstractChainableUberspector
- Returns:
- A Velocity Setter method.
- See Also:
Uberspect.getPropertySet(java.lang.Object, java.lang.String, java.lang.Object, org.apache.velocity.util.introspection.Info)
-
-