|
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.NullNodeLoader<I>
public class NullNodeLoader<I>
A node loader implementation that doesn't load any nodes.
This may be useful for NodeLoaderFactory
implementations
that wish to handle missing node loaders in the NodeLoaderFactory.createNodeLoader(Object)
method differently. Normally this should
result in an ItemNotFoundException
, but an alternative approach may
be to return this loader which will effectively make an end-point in the
node tree. This node loader can't be used for root nodes and will throw
an UnsupportedOperationException
if createRootNode(DbControl, OverviewContext, Object)
is called.
Constructor Summary | |
---|---|
NullNodeLoader()
|
Method Summary | |
---|---|
Node |
createForwardNode(DbControl dc,
OverviewContext context,
Node parentNode)
Create a forward-loading (from parent to child) node for the given parent node. |
Node |
createPropertyNode(DbControl dc,
OverviewContext context,
Node parentNode)
Create a property node for the given parent node. |
Node |
createReverseNode(DbControl dc,
OverviewContext context,
Node childNode)
Create a reverse-loading (from child to parent) node for the given child node. |
Node |
createRootNode(DbControl dc,
OverviewContext context,
I item)
Create a root node for the given item. |
boolean |
loadChildNodes(DbControl dc,
OverviewContext context,
Node node)
Load child nodes of the current node unless they have been loaded already. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullNodeLoader()
Method Detail |
---|
public Node createForwardNode(DbControl dc, OverviewContext context, Node parentNode)
NodeLoader
The direction of the node(s) should usually be ChildNodeDirection.FORWARD
.
In case there is an error (permission denied, etc.) ChildNodeDirection.NONE
should be used. If there is no child item null
should be returned.
Errors, missing items, etc. should be reported as failures to the OverviewContext
.
createForwardNode
in interface NodeLoader<I>
dc
- The DbControl to use for database accesscontext
- The overview contextparentNode
- The parent node
public Node createPropertyNode(DbControl dc, OverviewContext context, Node parentNode)
NodeLoader
The direction of the node(s) should usually be ChildNodeDirection.NONE
, but
it may also be ChildNodeDirection.PROPERTY
in case the property has sub-properties.
One example is the ProtocolLoader
which loads the
protocol parameters as child nodes.
In case there is an error (permission denied, etc.) ChildNodeDirection.NONE
should be used. If there is no property item null
should be returned (but this may also indicate that more than one node
was created).
Errors, missing items, etc. should be reported as failures to the OverviewContext
.
createPropertyNode
in interface NodeLoader<I>
dc
- The DbControl to use for database accesscontext
- The overview contextparentNode
- The parent node
public Node createReverseNode(DbControl dc, OverviewContext context, Node childNode)
NodeLoader
The direction of the node(s) should usually be ChildNodeDirection.REVERSE
.
In case there is an error (permission denied, etc.) ChildNodeDirection.NONE
should be used. If there is no parent item null
should be returned.
Errors, missing items, etc. should be reported as failures to the OverviewContext
.
createReverseNode
in interface NodeLoader<I>
dc
- The DbControl to use for database accesscontext
- The overview contextchildNode
- The child node
public Node createRootNode(DbControl dc, OverviewContext context, I item)
NodeLoader
ChildNodeDirection.ALL
so that both forward and reverse
child nodes are loaded.
createRootNode
in interface NodeLoader<I>
dc
- The DbControl to use for database accesscontext
- The overview contextitem
- The root item
UnsupportedOperationException
- Alwayspublic boolean loadChildNodes(DbControl dc, OverviewContext context, Node node)
NodeLoader
Node.getChildNodeDirection()
of the node.
loadChildNodes
in interface NodeLoader<I>
dc
- The DbControl to use for database accesscontext
- The overview contextnode
- The node
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |