public class AnnotationBoxingUberspect
extends org.apache.velocity.util.introspection.UberspectImpl
implements org.apache.velocity.util.RuntimeServicesAware
More specifically this uberspect will inspect any target method call or property for annotations that are marked as
ReturnValueAnnotations and box the result of calling or accessing the target with these annotations.
Since 1.5, this uberspect has also supported deprecation warnings for velocity using deprecated Java classes and methods. These warnings are exceptions in dev mode, but can be disabled using the atlassian.velocity.deprecation.strictmode system property. You should only disable the deprecation warnings if you cannot fix the velocity usage to avoid the deprecations, for backwards compatibility reasons.
org.apache.velocity.util.introspection.UberspectImpl.VelGetterImpl, org.apache.velocity.util.introspection.UberspectImpl.VelMethodImpl, org.apache.velocity.util.introspection.UberspectImpl.VelSetterImpl| Constructor and Description |
|---|
AnnotationBoxingUberspect() |
| Modifier and Type | Method and Description |
|---|---|
protected Class<?> |
getClassForTargetObject(Object targetObject)
Template method for returning the actual concrete class of a the provided object.
|
Iterator<?> |
getIterator(Object obj,
org.apache.velocity.util.introspection.Info info)
Get an iterator responsible for preserving annotations while iterating over a collection that has collection
inheritable return value annotations.'
|
org.apache.velocity.util.introspection.VelMethod |
getMethod(Object obj,
String methodName,
Object[] args,
org.apache.velocity.util.introspection.Info info)
Return a method that knows how to unbox method call targets and parameters and to box return values
according to the return value boxing policy.
|
protected Collection<Annotation> |
getMethodAnnotations(Method method)
Retrieve any annotations on the supplied method that are meta-annotated as a
ReturnValueAnnotation |
org.apache.velocity.util.introspection.VelPropertyGet |
getPropertyGet(Object obj,
String identifier,
org.apache.velocity.util.introspection.Info info)
Get a property getting strategy that will box the end result with any return value annotations on the property getter
|
void |
init() |
void |
setRuntimeServices(org.apache.velocity.runtime.RuntimeServices runtimeServices) |
public void init()
init in interface org.apache.velocity.util.introspection.Uberspectinit in class org.apache.velocity.util.introspection.UberspectImplpublic final org.apache.velocity.util.introspection.VelMethod getMethod(Object obj, String methodName, Object[] args, org.apache.velocity.util.introspection.Info info) throws Exception
getMethod in interface org.apache.velocity.util.introspection.UberspectgetMethod in class org.apache.velocity.util.introspection.UberspectImplobj - Object to locate the method onmethodName - Name of the method to locateargs - Method call argumentsinfo - Current template infoExceptionpublic final Iterator<?> getIterator(Object obj, org.apache.velocity.util.introspection.Info info) throws Exception
getIterator in interface org.apache.velocity.util.introspection.UberspectgetIterator in class org.apache.velocity.util.introspection.UberspectImplobj - object to get an iterator forinfo - current template infoExceptionpublic final org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(Object obj, String identifier, org.apache.velocity.util.introspection.Info info) throws Exception
getPropertyGet in interface org.apache.velocity.util.introspection.UberspectgetPropertyGet in class org.apache.velocity.util.introspection.UberspectImplobj - Object on which a property is being retrievedidentifier - Property identifierinfo - Current template infoExceptionpublic void setRuntimeServices(org.apache.velocity.runtime.RuntimeServices runtimeServices)
setRuntimeServices in interface org.apache.velocity.util.RuntimeServicesAwaresetRuntimeServices in class org.apache.velocity.util.introspection.UberspectImplprotected Collection<Annotation> getMethodAnnotations(Method method)
ReturnValueAnnotationmethod - Method to searchReturnValueAnnotations.protected Class<?> getClassForTargetObject(Object targetObject)
This method should be overridden in environments where objects may be proxied in such a way that method annotations are not reflected by the proxying object class.
This implementation simply returns targetObject.getClass()
targetObject - The object for which the class is being queriedCopyright © 2018 Atlassian. All rights reserved.