Deprecate/move CGLIB methods AopUtils=>ClassUtils

isCglibProxy* methods in AopUtils are useful in lower-level modules,
i.e. those that cannot depend on .aop.  Therefore copied these methods
to ClassUtils; deprecated the existing ones in AopUtils and now
delegating to the new location; switched all usage of
AopUtils#isCglibProxy* within the framework to use
ClassUtils#isCglibProxy* instead.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4679 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Chris Beams
2011-07-06 09:15:27 +00:00
parent 0130b15189
commit 075dfc3cb4
5 changed files with 49 additions and 14 deletions
@@ -1083,4 +1083,30 @@ public abstract class ClassUtils {
}
}
/**
* Check whether the given object is a CGLIB proxy.
* @param object the object to check
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
*/
public static boolean isCglibProxy(Object object) {
return ClassUtils.isCglibProxyClass(object.getClass());
}
/**
* Check whether the specified class is a CGLIB-generated class.
* @param clazz the class to check
*/
public static boolean isCglibProxyClass(Class<?> clazz) {
return (clazz != null && isCglibProxyClassName(clazz.getName()));
}
/**
* Check whether the specified class name is a CGLIB-generated class.
* @param className the class name to check
*/
public static boolean isCglibProxyClassName(String className) {
return (className != null && className.contains(CGLIB_CLASS_SEPARATOR));
}
}