|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.clazz.ClazzLoader org.apache.commons.clazz.reflect.ReflectedClazzLoader
public abstract class ReflectedClazzLoader
Constructor Summary | |
---|---|
ReflectedClazzLoader(ModelClazzLoader modelClazzLoader,
ClassLoader classLoader)
|
Method Summary | |
---|---|
protected abstract Clazz |
createClazz(Class javaClass)
Override this method to construct an Clazz for the given Class (javaClass). |
Clazz |
defineClazz(String name,
Class clazzClass,
Class instanceClass)
Defines a new Clazz with the supplied name. |
Clazz |
getClazzForName(String name)
Given a Clazz name, returns the corresponding Clazz. |
String |
getClazzName(Object instance)
Returns the clazz name for the supplied instance. |
boolean |
isMember(Object instance)
Returns true for all objects. |
protected boolean |
isSupportedClass(Class javaClass)
Returns true for all classes supported by this specific clazz loader. |
protected Clazz |
lookupCustomClazz(Class javaClass)
Try to find and allocate a custom Clazz for the specified Java class. |
Methods inherited from class org.apache.commons.clazz.ClazzLoader |
---|
enableLogging, getClazz, getModel, getModelClazzLoader, isLoggingEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectedClazzLoader(ModelClazzLoader modelClazzLoader, ClassLoader classLoader)
Method Detail |
---|
public String getClazzName(Object instance)
ClazzLoader
null
if it cannot produce a clazz name for the instance.
getClazzName
in class ClazzLoader
public Clazz getClazzForName(String name)
ClazzLoader
Note that we use canonical class names for primitive types and arrays, e.g. "byte", "byte[]", "boolean[][]", "java.lang.String[]".
getClazzForName
in class ClazzLoader
protected Clazz lookupCustomClazz(Class javaClass)
javaClass
-
public boolean isMember(Object instance)
true
for all objects.
isMember
in class ClazzLoader
ClazzLoader.isMember(Object)
protected boolean isSupportedClass(Class javaClass)
protected abstract Clazz createClazz(Class javaClass)
this
.
public Clazz defineClazz(String name, Class clazzClass, Class instanceClass)
ClazzLoader
defineClazz
in class ClazzLoader
name
- the name of the clazz, should be unique within the scope of
the top-level ClazzLoaderclazzClass
- the Class of the Clazz that this method needs to
produce.instanceClass
- the Class of the instances the new Clazz will be
able to create using the newInstance()
method.
ClazzLoader.defineClazz(String, Class, Class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |