|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.overview.loader.BasicItemNodeLoaderFactory
public class BasicItemNodeLoaderFactory
Node loader factory implementation for BasicItem
node loaders.
The key used in createNodeLoader(Object)
should normally be
an Item
object.
Field Summary | |
---|---|
private boolean |
autoLoadChildren
|
private static boolean |
debug
|
private Map<Object,Class<? extends NodeLoader<? extends BasicItem>>> |
loaders
|
private static Logger |
log
|
private boolean |
useNullLoader
|
Constructor Summary | |
---|---|
BasicItemNodeLoaderFactory()
Creates a new factory. |
Method Summary | |
---|---|
NodeLoader<? extends BasicItem> |
createNodeLoader(Object key)
Create a new node loader for loading nodes for the specified item type. |
boolean |
isAutoLoadingChildren()
Get the auto load children setting. |
protected void |
registerCheckedNodeLoader(Object key,
Class<? extends NodeLoader<? extends BasicItem>> loaderClass)
Register a node loader implementation that you are sure fulfills the requirements. |
protected void |
registerDefaultNodeLoaders()
Registers default item node loaders from BioSource
to Experiment , etc. |
void |
registerNodeLoader(Object key,
Class<? extends NodeLoader<? extends BasicItem>> loaderClass)
Register a node loader implementation. |
void |
setAutoLoadChildren(boolean autoLoadChildren)
Set a flag that determines if the factory should create node loaders that automatically loads child nodes or not. |
void |
setUseNullLoaderIfNotFound(boolean useNullLoader)
Set a flag that determines if a NullNodeLoader should be used
or if an ItemNotFoundException should be thrown
if no registered node loader is found for a specific key. |
boolean |
useNullLoaderIfNotFound()
Get the null loader setting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private static final boolean debug
private final Map<Object,Class<? extends NodeLoader<? extends BasicItem>>> loaders
private boolean autoLoadChildren
private boolean useNullLoader
Constructor Detail |
---|
public BasicItemNodeLoaderFactory()
Method Detail |
---|
public NodeLoader<? extends BasicItem> createNodeLoader(Object key)
NullNodeLoader
is returned or an exception is thrown
depending on the useNullLoaderIfNotFound()
option.
createNodeLoader
in interface NodeLoaderFactory<BasicItem,Object>
key
- An Item
object
ItemNotFoundException
- If no node loader is found and the
useNullLoaderIfNotFound()
setting is falsepublic void registerNodeLoader(Object key, Class<? extends NodeLoader<? extends BasicItem>> loaderClass) throws NoSuchMethodException, ClassCastException
ClassUtil.checkAndLoadClass(ClassLoader, String, boolean, Class...)
key
- The item type the node loader handlesloaderClass
- The class name of a class that implements NodeLoader
,
or null to unregister a node loader
NoSuchMethodException
- If the given class has no public no-argument
constructor
ClassCastException
- If the given class doesn't implement the
NodeLoader
interfaceprotected void registerCheckedNodeLoader(Object key, Class<? extends NodeLoader<? extends BasicItem>> loaderClass)
NodeLoader
interface.
registerNodeLoader(Object, Class)
public void setAutoLoadChildren(boolean autoLoadChildren)
AutoChildNodeLoader
.
This will generate a recursive pattern if the used node loader:
OverviewContext.getNodeLoaderFactory()
.
The node loader should NOT instantiate child new loaders by itself.
AbstractNodeLoader
.
autoLoadChildren
- TRUE to create node loaders that automatically
loads children, FALSE otherwisepublic boolean isAutoLoadingChildren()
public boolean useNullLoaderIfNotFound()
setUseNullLoaderIfNotFound(boolean)
public void setUseNullLoaderIfNotFound(boolean useNullLoader)
NullNodeLoader
should be used
or if an ItemNotFoundException
should be thrown
if no registered node loader is found for a specific key.
useNullLoader
- TRUE to use a NullNodeLoader, FALSE to throw
an exceptionprotected void registerDefaultNodeLoaders()
BioSource
to Experiment
, etc.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |