|
||||||||||
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.common.GroupClazzLoader
public class GroupClazzLoader
Aggregates multiple ClazzLoaders, which are invoked one after another according to the ChainOfResponsibility pattern. Note that member clazz loaders are invoked in the order reverse to the order they were added.
Field Summary | |
---|---|
protected ArrayList |
loaders
List of member loaders. |
Constructor Summary | |
---|---|
GroupClazzLoader(ModelClazzLoader modelClazzLoader)
|
Method Summary | |
---|---|
void |
addClazzLoader(ClazzLoader loader)
Adds a ClazzLoader to the group. |
boolean |
canAddClazzLoader(ClazzLoader loader)
Returns true if the supplied loader "belongs" in the group and can be added to it. |
Clazz |
defineClazz(String name,
Class clazzClass,
Class instanceClass)
Defines a new Clazz with the supplied name. |
Clazz |
getClazzForName(String name)
Given a Clazz name, produces the corresponding Clazz by invoking member loaders one by one until the clazz is found. |
List |
getClazzLoaders()
Returns all clazz loaders registered with this group, in the order of priority |
String |
getClazzName(Object instance)
Returns the clazz name for the supplied instance. |
boolean |
isMember(Object instance)
Returns true iff this group has a member loader that has or can construct a Clazz for the supplied instance. |
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 |
Field Detail |
---|
protected ArrayList loaders
Constructor Detail |
---|
public GroupClazzLoader(ModelClazzLoader modelClazzLoader)
Method Detail |
---|
public boolean canAddClazzLoader(ClazzLoader loader)
public void addClazzLoader(ClazzLoader loader)
public boolean isMember(Object instance)
isMember
in class ClazzLoader
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)
getClazzForName
in class ClazzLoader
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)
public List getClazzLoaders()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |