@Deprecated public class LinkingUberspector extends org.apache.velocity.util.introspection.UberspectImpl implements org.apache.velocity.util.introspection.Uberspect, org.apache.velocity.util.RuntimeServicesAware
Since the current version of the Velocity engine (1.5) does not allow more than one uberspector, this class is a
workaround. It manually constructs an array of uberspectors, loading the classes in the order
defined in the "runtime.introspector.uberspect.arrayClasses"
property, and after that forwards calls to
each of the uberspectors, in order, until one of them returns something different than null
. Note that
the calls will be made from the leftmost class to the rightmost one. This allows building and combining different
small uberspectors that perform a specialised search for methods, instead of bloating a single class with different
introspection tricks.
This is not actually part of the array, but is more of a handle that allows the calls intended for only one uberspector to reach the array. It duplicates some of the code from the velocity runtime initialization code, hoping that a future version of the engine will support this natively.
The array is defined using the configuration parameter runtime.introspector.uberspect.arrayClasses
. This
property should contain a list of canonical class names. Any wrong entry in the list will be ignored. If this
property is not defined or contains only wrong classnames, then by default a SecureUberspector
is used
as the only entry in the array.
ChainingUberspector
org.apache.velocity.util.introspection.UberspectImpl.VelGetterImpl, org.apache.velocity.util.introspection.UberspectImpl.VelMethodImpl, org.apache.velocity.util.introspection.UberspectImpl.VelSetterImpl
Modifier and Type | Field and Description |
---|---|
static String |
UBERSPECT_ARRAY_CLASSNAMES
Deprecated.
The key of the parameter that allows defining the array of uberspectors.
|
Constructor and Description |
---|
LinkingUberspector()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Iterator |
getIterator(Object obj,
org.apache.velocity.util.introspection.Info i)
Deprecated.
|
org.apache.velocity.util.introspection.VelMethod |
getMethod(Object obj,
String methodName,
Object[] args,
org.apache.velocity.util.introspection.Info i)
Deprecated.
|
org.apache.velocity.util.introspection.VelPropertyGet |
getPropertyGet(Object obj,
String identifier,
org.apache.velocity.util.introspection.Info i)
Deprecated.
|
org.apache.velocity.util.introspection.VelPropertySet |
getPropertySet(Object obj,
String identifier,
Object arg,
org.apache.velocity.util.introspection.Info i)
Deprecated.
|
void |
init()
Deprecated.
|
protected void |
initializeUberspector(String classname)
Deprecated.
Instantiates and initializes an uberspector class and adds it to the array.
|
protected org.apache.velocity.util.introspection.Uberspect |
instantiateUberspector(String classname)
Deprecated.
Tries to create an uberspector instance using reflection.
|
getConversionHandler, setLog, setRuntimeServices
public static final String UBERSPECT_ARRAY_CLASSNAMES
public void init()
This implementation initializes the array of uberspectors.
init
in interface org.apache.velocity.util.introspection.Uberspect
init
in class org.apache.velocity.util.introspection.UberspectImpl
Uberspect.init()
protected void initializeUberspector(String classname)
classname
- The name of the uberspector class to add to the chain.protected org.apache.velocity.util.introspection.Uberspect instantiateUberspector(String classname)
classname
- The name of the uberspector class to instantiate.Uberspect
, null
is returned.public Iterator getIterator(Object obj, org.apache.velocity.util.introspection.Info i)
getIterator
in interface org.apache.velocity.util.introspection.Uberspect
getIterator
in class org.apache.velocity.util.introspection.UberspectImpl
public org.apache.velocity.util.introspection.VelMethod getMethod(Object obj, String methodName, Object[] args, org.apache.velocity.util.introspection.Info i)
getMethod
in interface org.apache.velocity.util.introspection.Uberspect
getMethod
in class org.apache.velocity.util.introspection.UberspectImpl
public org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(Object obj, String identifier, org.apache.velocity.util.introspection.Info i)
getPropertyGet
in interface org.apache.velocity.util.introspection.Uberspect
getPropertyGet
in class org.apache.velocity.util.introspection.UberspectImpl
public org.apache.velocity.util.introspection.VelPropertySet getPropertySet(Object obj, String identifier, Object arg, org.apache.velocity.util.introspection.Info i)
getPropertySet
in interface org.apache.velocity.util.introspection.Uberspect
getPropertySet
in class org.apache.velocity.util.introspection.UberspectImpl
Copyright © 2004–2021 XWiki. All rights reserved.