public class AnnotationBoxingUberspect
extends org.apache.velocity.util.introspection.UberspectImpl
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.
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() |
public void init()
throws Exception
init in interface org.apache.velocity.util.introspection.Uberspectinit in class org.apache.velocity.util.introspection.UberspectImplExceptionpublic 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 infoExceptionprotected Collection<Annotation> getMethodAnnotations(Method method)
ReturnValueAnnotationmethod - Method to searchReturnValueAnnotation on the provided method.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 © 2003–2016 Atlassian. All rights reserved.