|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.aop.support.AopUtils
Utility methods used by the AOP framework and by AOP proxy factories. Not intended to be used directly by applications.
| Constructor Summary | |
AopUtils()
|
|
| Method Summary | |
static boolean |
canApply(Advisor advisor,
Class targetClass)
Can the given advisor apply at all on the given class? |
static boolean |
canApply(Pointcut pc,
Class targetClass)
Can the given pointcut apply at all on the given class? |
static Class[] |
getAllInterfaces(Object object)
Return all interfaces that the given object implements as array, including ones implemented by superclasses. |
static List |
getAllInterfacesAsList(Object object)
Return all interfaces that the given object implements as List, including ones implemented by superclasses. |
static Class[] |
getAllInterfacesForClass(Class clazz)
Return all interfaces that the given class implements as array, including ones implemented by superclasses. |
static List |
getAllInterfacesForClassAsList(Class clazz)
Return all interfaces that the given class implements as List, including ones implemented by superclasses. |
static Method |
getMostSpecificMethod(Method method,
Class targetClass)
Given a method, which may come from an interface, and a targetClass used in the current AOP invocation, find the most specific method if there is one. |
static String |
interfacesString(Collection interfaces)
Build a String that consists of the names of the interfaces in the given collection. |
static Object |
invokeJoinpointUsingReflection(Object target,
Method method,
Object[] args)
Invoke the target directly via reflection. |
static boolean |
isAopProxy(Object object)
Return whether the given object is either a J2SE dynamic proxy or a CGLIB proxy. |
static boolean |
isCglibProxy(Object object)
Return whether the given object is a CGLIB proxy. |
static boolean |
isCglibProxyClass(Class clazz)
Return whether the specified class is a CGLIB-generated class. |
static boolean |
isEqualsMethod(Method method)
Return whether the given method is an "equals" method. |
static boolean |
isHashCodeMethod(Method method)
Return whether the given method is a "hashCode" method. |
static boolean |
isJdkDynamicProxy(Object object)
Return whether the given object is a J2SE dynamic proxy. |
static boolean |
isToStringMethod(Method method)
Return whether the given method is an "toString" method. |
static Class[] |
toInterfaceArray(String[] interfaceNames)
Convenience method to convert a string array of interface names to a class array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AopUtils()
| Method Detail |
public static boolean isAopProxy(Object object)
object - the object to checkisJdkDynamicProxy(java.lang.Object),
isCglibProxy(java.lang.Object)public static boolean isJdkDynamicProxy(Object object)
object - the object to checkProxy.isProxyClass(java.lang.Class)public static boolean isCglibProxy(Object object)
object - the object to checkpublic static boolean isCglibProxyClass(Class clazz)
clazz - the class to checkpublic static boolean isEqualsMethod(Method method)
Object.equals(java.lang.Object)public static boolean isHashCodeMethod(Method method)
Object.hashCode()public static boolean isToStringMethod(Method method)
Object.toString()
public static Method getMostSpecificMethod(Method method,
Class targetClass)
method - method to be invoked, which may come from an interfacetargetClass - target class for the curren invocation. May
be null or may not even implement the method.
public static Class[] toInterfaceArray(String[] interfaceNames)
throws IllegalArgumentException,
ClassNotFoundException
IllegalArgumentException - if any of the classes is not an interface
ClassNotFoundException - if any of the classes can't be loadedpublic static String interfacesString(Collection interfaces)
interfaces - collection of Class objects that represent interfaces.
public static Class[] getAllInterfaces(Object object)
object - the object to analyse for interfaces
public static Class[] getAllInterfacesForClass(Class clazz)
clazz - the class to analyse for interfaces
public static List getAllInterfacesAsList(Object object)
object - the object to analyse for interfaces
public static List getAllInterfacesForClassAsList(Class clazz)
clazz - the class to analyse for interfaces
public static boolean canApply(Pointcut pc,
Class targetClass)
pc - pc static or dynamic pointcut to checktargetClass - class we're testing
public static boolean canApply(Advisor advisor,
Class targetClass)
advisor - the advisor to checktargetClass - class we're testing
public static Object invokeJoinpointUsingReflection(Object target,
Method method,
Object[] args)
throws Throwable
target - the target objectmethod - the method to invokeargs - the arguments for the method
Throwable - if thrown by the target method
AspectException - if encountering
a reflection error
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||