|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.osgi.util.ClassUtils
public abstract class ClassUtils
Class utility used internally. Contains mianly class inheritance mechanisms used when creating OSGi service proxies.
Field Summary | |
---|---|
static int |
INCLUDE_ALL_CLASSES
Include all inherited classes (classes or interfaces). |
static int |
INCLUDE_CLASS_HIERARCHY
Include only the class hierarchy (interfaces are excluded). |
static int |
INCLUDE_INTERFACES
Include only the interfaces inherited from superclasses or implemented by the current class. |
Constructor Summary | |
---|---|
ClassUtils()
|
Method Summary | |
---|---|
static boolean |
concurrentLibAvailable()
Check the present of approapriate concurrent collection in the classpath. |
static void |
configureFactoryForClass(ProxyFactory factory,
Class[] classes)
Based on the given class, properly instruct the ProxyFactory proxies. |
static boolean |
containsUnrelatedClasses(Class[] classes)
Determining if multiple classes(not interfaces) are specified, without any relation to each other. |
static Class[] |
getAllInterfaces(Class clazz)
Get all interfaces implemented by the given class. |
static Class[] |
getClassHierarchy(Class clazz,
int mode)
Return an array of parent classes for the given class. |
static ClassLoader |
getClassLoader(Class clazz)
Return the classloader for the given class. |
static Class[] |
getVisibleClasses(Class[] classes,
Bundle bundle)
Given an array of classes, eliminate the ones that cannot be loaded by the given bundle. |
static Class[] |
getVisibleClasses(Class[] classes,
ClassLoader classLoader)
Given an array of classes, eliminate the ones that cannot be loaded by the given classloader. |
static Class[] |
getVisibleClassHierarchy(Class clazz,
int mode,
Bundle bundle)
'Sugar' method that determines the class hierarchy of the given class, returning only the classes visible to the given bundle. |
static Class[] |
getVisibleClassHierarchy(Class clazz,
int mode,
ClassLoader loader)
Sugar method, determining the class hierarchy of a given class and then filtering based on the given classloader. |
static boolean |
isPresent(String className,
Bundle bundle)
Check the present of a class inside a bundle. |
static Class[] |
removeParents(Class[] classes)
Parse the given class array and eliminate parents of existing classes. |
static String[] |
toStringArray(Class[] array)
Return an array of class string names for the given classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INCLUDE_INTERFACES
public static final int INCLUDE_CLASS_HIERARCHY
public static final int INCLUDE_ALL_CLASSES
Constructor Detail |
---|
public ClassUtils()
Method Detail |
---|
public static Class[] getClassHierarchy(Class clazz, int mode)
Constants.OBJECTCLASS
property.
Note: this method does class expansion returning parent as well as
children classes.
clazz
- mode
- classLoader
-
INCLUDE_ALL_CLASSES
,
INCLUDE_CLASS_HIERARCHY
,
INCLUDE_INTERFACES
public static Class[] getVisibleClassHierarchy(Class clazz, int mode, ClassLoader loader)
clazz
- mode
- loader
-
public static Class[] getVisibleClassHierarchy(Class clazz, int mode, Bundle bundle)
clazz
- the class for which the hierarchy has to be determinedmode
- discovery modebundle
- bundle used for class visibility
public static Class[] getVisibleClasses(Class[] classes, ClassLoader classLoader)
public static Class[] getVisibleClasses(Class[] classes, Bundle bundle)
public static Class[] getAllInterfaces(Class clazz)
clazz
-
public static boolean isPresent(String className, Bundle bundle)
className
- bundle
-
public static ClassLoader getClassLoader(Class clazz)
clazz
-
public static String[] toStringArray(Class[] array)
array
-
public static boolean concurrentLibAvailable()
public static boolean containsUnrelatedClasses(Class[] classes)
classes
- an array of classes
public static Class[] removeParents(Class[] classes)
classes
- array of classes
containsUnrelatedClasses(Class[])
,
configureFactoryForClass(ProxyFactory, Class[])
public static void configureFactoryForClass(ProxyFactory factory, Class[] classes)
factory
- classes
- containsUnrelatedClasses(Class[])
,
removeParents(Class[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |