Class ExtensionChildNodeLoader<I>

java.lang.Object
net.sf.basedb.util.overview.loader.ExtensionChildNodeLoader<I>
All Implemented Interfaces:
NodeLoader<I>

public class ExtensionChildNodeLoader<I> extends Object implements NodeLoader<I>
Wrapper for node loaders that automatically hooks into the extension system when loading child nodes for a parent node. It works by first delegating all method calls to the parent node loader, but the loadChildNodes(DbControl, OverviewContext, Node) contains additional logic to query the extension system and call ChildNodeLoaderAction.createChildNodes(DbControl, OverviewContext, Node) for any action created by the an extension.
Since:
3.2
Author:
Nicklas
  • Field Details

  • Constructor Details

    • ExtensionChildNodeLoader

      public ExtensionChildNodeLoader(NodeLoader<I> parent)
      Wrap the given parent node loader.
  • Method Details

    • createForwardNode

      public Node createForwardNode(DbControl dc, OverviewContext context, Node parentNode)
      Call the same method on the 'parent' node loader.
      Specified by:
      createForwardNode in interface NodeLoader<I>
      Parameters:
      dc - The DbControl to use for database access
      context - The overview context
      parentNode - The parent node
      Returns:
      The node that the parent node loader creates (may be null)
    • createPropertyNode

      public Node createPropertyNode(DbControl dc, OverviewContext context, Node parentNode)
      Call the same method on the 'parent' node loader.
      Specified by:
      createPropertyNode in interface NodeLoader<I>
      Parameters:
      dc - The DbControl to use for database access
      context - The overview context
      parentNode - The parent node
      Returns:
      The node that the parent node loader creates (may be null)
    • createReverseNode

      public Node createReverseNode(DbControl dc, OverviewContext context, Node childNode)
      Call the same method on the 'parent' node loader. If one or more child nodes are added to the parent node, the loadChildNodes(DbControl, OverviewContext, Node) is called for each of the new nodes.
      Specified by:
      createReverseNode in interface NodeLoader<I>
      Parameters:
      dc - The DbControl to use for database access
      context - The overview context
      childNode - The child node
      Returns:
      The node that the parent node loader creates (may be null)
    • createRootNode

      public Node createRootNode(DbControl dc, OverviewContext context, I item)
      Call the same method on the 'parent' node loader.
      Specified by:
      createRootNode in interface NodeLoader<I>
      Parameters:
      dc - The DbControl to use for database access
      context - The overview context
      item - The root item
      Returns:
      The node that the parent node loader creates (may be null)
    • loadChildNodes

      public boolean loadChildNodes(DbControl dc, OverviewContext context, Node node)
      Call the same method on the 'parent' node loader. Then, check the extension system for extensions to the 'net.sf.basedb.util.overview.loader' extension point and ask the factories for ChildNodeLoaderAction:s and let each of them create their child nodes.
      Specified by:
      loadChildNodes in interface NodeLoader<I>
      Parameters:
      dc - The DbControl to use for database access
      context - The overview context
      node - The node
      Returns:
      TRUE if new nodes were added to the parent node, FALSE if not
    • toString

      public String toString()
      Overrides:
      toString in class Object