org.granite.messaging.jmf.reflect
Class Reflection

java.lang.Object
  extended by org.granite.messaging.jmf.reflect.Reflection

public class Reflection
extends Object

Author:
Franck WOLFF

Field Summary
protected  ClassLoader classLoader
           
protected  ConstructorFactory constructorFactory
           
protected  Comparator<Field> lexicalFieldComparator
           
protected  ConcurrentMap<Class<?>,List<Field>> serializableFieldsCache
           
protected static int STATIC_TRANSIENT_MASK
           
 
Constructor Summary
Reflection(ClassLoader classLoader)
           
 
Method Summary
<T> Constructor<T>
findDefaultContructor(Class<T> cls)
           
protected  List<Field> findSerializableDeclaredFields(Class<?> cls)
           
 List<Field> findSerializableFields(Class<?> cls)
           
 ClassLoader getClassLoader()
           
 boolean isRegularClass(Class<?> cls)
           
 Class<?> loadClass(String className)
           
<T> T
newInstance(Class<T> cls)
           
<T> T
newInstance(String className)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATIC_TRANSIENT_MASK

protected static final int STATIC_TRANSIENT_MASK
See Also:
Constant Field Values

classLoader

protected final ClassLoader classLoader

constructorFactory

protected final ConstructorFactory constructorFactory

lexicalFieldComparator

protected final Comparator<Field> lexicalFieldComparator

serializableFieldsCache

protected final ConcurrentMap<Class<?>,List<Field>> serializableFieldsCache
Constructor Detail

Reflection

public Reflection(ClassLoader classLoader)
Method Detail

getClassLoader

public ClassLoader getClassLoader()

loadClass

public Class<?> loadClass(String className)
                   throws ClassNotFoundException
Throws:
ClassNotFoundException

newInstance

public <T> T newInstance(Class<T> cls)
              throws InstantiationException,
                     IllegalAccessException,
                     IllegalArgumentException,
                     InvocationTargetException,
                     SecurityException,
                     NoSuchMethodException
Throws:
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
SecurityException
NoSuchMethodException

newInstance

public <T> T newInstance(String className)
              throws ClassNotFoundException,
                     InstantiationException,
                     IllegalAccessException,
                     IllegalArgumentException,
                     InvocationTargetException,
                     SecurityException,
                     NoSuchMethodException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
SecurityException
NoSuchMethodException

findDefaultContructor

public <T> Constructor<T> findDefaultContructor(Class<T> cls)
                                     throws SecurityException,
                                            NoSuchMethodException
Throws:
SecurityException
NoSuchMethodException

findSerializableFields

public List<Field> findSerializableFields(Class<?> cls)
                                   throws SecurityException
Throws:
SecurityException

findSerializableDeclaredFields

protected List<Field> findSerializableDeclaredFields(Class<?> cls)
                                              throws SecurityException
Throws:
SecurityException

isRegularClass

public boolean isRegularClass(Class<?> cls)