|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.clazz.common.ClazzElementSupport org.apache.commons.clazz.Clazz
public abstract class Clazz
Field Summary | |
---|---|
static String |
EXTENDED_CLAZZ_MODEL
The name of the extended clazz model. |
static String |
STANDARD_CLAZZ_MODEL
The name of the standard clazz model. |
Constructor Summary | |
---|---|
protected |
Clazz(ClazzLoader modelClazzLoader,
String name)
Keep the constructor protected or private, we want Clazzes to be created by the ClazzLoaders only. |
Method Summary | |
---|---|
void |
addClazzChangeListener(ClazzChangeListener listener)
|
static void |
addClazzLoaderFactory(ClazzLoaderFactory factory)
Register a clazz loader factory, which manages ClazzLoaders, which manage Clazzes. |
static String |
constructSignature(String name,
Class[] arguments)
Creates a signature string out of an operation or instance factory name and parameter types. |
static String |
constructSignature(String name,
Clazz[] arguments)
Creates a signature string out of an operation or instance factory name and parameter types. |
protected void |
fireInstanceFactoryAdded(ClazzInstanceFactory factory)
|
protected void |
fireInstanceFactoryRemoved(ClazzInstanceFactory factory)
|
protected void |
fireOperationAdded(ClazzOperation operation)
|
protected void |
fireOperationRemoved(ClazzOperation operation)
|
protected void |
firePropertyAdded(ClazzProperty property)
|
protected void |
firePropertyRemoved(ClazzProperty property)
|
static String |
getCanonicalClassName(Class javaClass)
Produces a nice type name for a classes representing an array, e.g. |
static Clazz |
getClazz(Object instance)
Uses the default clazz loader to obtain the Clazz for the supplied object. |
static Clazz |
getClazz(Object instance,
String model)
Uses the clazz loader for the specified model to obtain the Clazz for the supplied object. |
ClazzLoader |
getClazzLoader()
Every Clazz belongs to one and only one ClazzLoader. |
static ClazzLoader |
getClazzLoader(String model,
ClassLoader classLoader)
Returns a clazz loader for the specified model. |
static ClazzLoaderFactory |
getClazzLoaderFactory(String model)
Returns a ClazzLoaderFactory registered for the supplied model. |
abstract List |
getDeclaredOperations()
Returns all Operations declared by this clazz, not its superclazzes. |
abstract List |
getDeclaredProperties()
Returns properties declared by this Clazz, not its superclazzes |
static ClazzLoader |
getDefaultClazzLoader(ClassLoader classLoader)
Returns the ClazzLoader for the default clazz model. |
static String |
getDefaultClazzModel()
Returns the name of the default clazz model. |
abstract Class |
getInstanceClass()
Returns the class of instances created by the newInstance()
method. |
abstract List |
getInstanceFactories()
Returns all InstanceFactories for this clazz. |
abstract ClazzInstanceFactory |
getInstanceFactory(String signature)
Returns ClazzInstanceFactory for the given signature. |
String |
getName()
Returns the name of the Clazz. |
abstract ClazzOperation |
getOperation(String signature)
Returns the Operation for the given signature. |
abstract List |
getOperations()
Returns all Operations for this clazz. |
String |
getPackageName()
Gets the package name. |
abstract List |
getProperties()
Returns all properties for this clazz, including those declared by superclazzes. |
abstract ClazzProperty |
getProperty(String name)
Returns a ClazzProperty for the given name |
String |
getShortClassName()
Gets the class name (without the package). |
abstract Clazz |
getSuperclazz()
Returns the superclazz for this Clazz, or null if there is none. |
boolean |
isAssignableFrom(Clazz clazz)
Returns true if the supplied clazz is either the same or a subclazz of this clazz. |
Object |
newInstance()
Creates a new instance of this Clazz using the InstanceFactory that takes no parameters. |
Object |
newInstance(String signature,
Object[] parameters)
Creates a new instance of this Clazz using the InstanceFactory with the specified signature. |
void |
removeClazzChangeListener(ClazzChangeListener listener)
|
static void |
setDefaultClazzModel(String defaultClazzModel)
Select the default clazz model. |
Methods inherited from class org.apache.commons.clazz.common.ClazzElementSupport |
---|
getAttribute, getAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.clazz.ClazzElement |
---|
getAttribute, getAttributes |
Field Detail |
---|
public static final String STANDARD_CLAZZ_MODEL
public static final String EXTENDED_CLAZZ_MODEL
Constructor Detail |
---|
protected Clazz(ClazzLoader modelClazzLoader, String name)
loader
- is the owning model clazz loadername
- must be unique within the modelMethod Detail |
---|
public static void addClazzLoaderFactory(ClazzLoaderFactory factory)
clazzLoaderFactory
- public static ClazzLoaderFactory getClazzLoaderFactory(String model)
model
- is the type of the model we need
public static void setDefaultClazzModel(String defaultClazzModel)
defaultClazzModel
- public static String getDefaultClazzModel()
public static ClazzLoader getClazzLoader(String model, ClassLoader classLoader)
model
- classLoader
-
public static ClazzLoader getDefaultClazzLoader(ClassLoader classLoader)
public static Clazz getClazz(Object instance, String model)
public static Clazz getClazz(Object instance)
public ClazzLoader getClazzLoader()
public String getName()
public String getPackageName()
public String getShortClassName()
public abstract Class getInstanceClass()
newInstance()
method.
public abstract Clazz getSuperclazz()
public boolean isAssignableFrom(Clazz clazz)
public abstract List getDeclaredProperties()
public abstract List getProperties()
public abstract ClazzProperty getProperty(String name)
public abstract List getOperations()
public abstract List getDeclaredOperations()
public abstract ClazzOperation getOperation(String signature)
"name(paramClazzName1,...)"
public abstract List getInstanceFactories()
public abstract ClazzInstanceFactory getInstanceFactory(String signature)
"(paramClazzName1,...)"
. You
can pass null
in place of "()"
.
public Object newInstance()
public Object newInstance(String signature, Object[] parameters)
public void addClazzChangeListener(ClazzChangeListener listener)
public void removeClazzChangeListener(ClazzChangeListener listener)
protected void firePropertyAdded(ClazzProperty property)
protected void firePropertyRemoved(ClazzProperty property)
protected void fireOperationAdded(ClazzOperation operation)
protected void fireOperationRemoved(ClazzOperation operation)
protected void fireInstanceFactoryAdded(ClazzInstanceFactory factory)
protected void fireInstanceFactoryRemoved(ClazzInstanceFactory factory)
public static String constructSignature(String name, Class[] arguments)
public static String constructSignature(String name, Clazz[] arguments)
public static String getCanonicalClassName(Class javaClass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |