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
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:
-
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
ConstructorDescriptionLinkingUberspector
(Uberspect left, Uberspect right) Constructor that takes the two uberspectors to link -
Method Summary
Modifier and TypeMethodDescriptiongetIterator
(Object obj, Info i) To support iterative objects used in a#foreach()
loop.MethodgetPropertyGet
(Object obj, String identifier, Info i) Property gettergetPropertySet
(Object obj, String identifier, Object arg, Info i) Property settervoid
init()
init - the chainable uberspector is responsible for the initialization of the wrapped uberspectorMethods inherited from class org.apache.velocity.util.introspection.AbstractChainableUberspector
wrap
Methods inherited from class org.apache.velocity.util.introspection.UberspectImpl
getConversionHandler, setLog, setRuntimeServices
-
Constructor Details
-
LinkingUberspector
Constructor that takes the two uberspectors to link- Parameters:
left
- left uberspectorright
- right uberspector
-
-
Method Details
-
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:
-
getIterator
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:
-
getMethod
Method- Specified by:
getMethod
in interfaceUberspect
- Overrides:
getMethod
in classAbstractChainableUberspector
- Parameters:
obj
-methodName
-args
-i
-- Returns:
- A Velocity Method.
- See Also:
-
getPropertyGet
Property getter- Specified by:
getPropertyGet
in interfaceUberspect
- Overrides:
getPropertyGet
in classAbstractChainableUberspector
- Parameters:
obj
-identifier
-i
-- Returns:
- A Velocity Getter Method.
- See Also:
-
getPropertySet
Property setter- Specified by:
getPropertySet
in interfaceUberspect
- Overrides:
getPropertySet
in classAbstractChainableUberspector
- Parameters:
obj
-identifier
-arg
-i
-- Returns:
- A Velocity Setter method.
- See Also:
-