Class ExtensionNodeValidator<I>

java.lang.Object
net.sf.basedb.util.overview.validator.ExtensionNodeValidator<I>
All Implemented Interfaces:
NodeValidator<I>

public class ExtensionNodeValidator<I> extends Object implements NodeValidator<I>
Wrapper for node validators that hooks into the extension system when validating nodes. The parent (or core) validator is always invoked first, then the extension system is queried for additional validators. Methods that return a value return the result from the last call (unless nothing else is specified).
Since:
3.2
Author:
Nicklas
  • Field Details

  • Constructor Details

    • ExtensionNodeValidator

      public ExtensionNodeValidator(NodeValidator<I> parent, Object key)
      Wrap the given parent node validator.
  • Method Details

    • preMissingItem

      public boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions. The result from the last call is returned.
      Specified by:
      preMissingItem in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      parentNode - The parent node that is missing the item
      Returns:
      TRUE if a node should be created, FALSE if not
    • preDeniedItem

      public boolean preDeniedItem(DbControl dc, OverviewContext context, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions. The result from the last call is returned.
      Specified by:
      preDeniedItem in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      parentNode - The parent node that is linked with the item
      Returns:
      TRUE if a node should be created, FALSE if not
    • preValidate

      public boolean preValidate(DbControl dc, OverviewContext context, I item, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions. The result from the last call is returned.
      Specified by:
      preValidate in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      item - The item to validate
      parentNode - The parent node that is linked with the item
      Returns:
      TRUE if a node should be created, FALSE if not
    • postMissingItem

      public void postMissingItem(DbControl dc, OverviewContext context, Node node, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions.
      Specified by:
      postMissingItem in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      node - The node object that represents the missing item
      parentNode - The parent node that is missing the item
    • postDeniedItem

      public void postDeniedItem(DbControl dc, OverviewContext context, Node node, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions.
      Specified by:
      postDeniedItem in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      node - The node object that represents the unaccessible item
      parentNode - The parent node that is linked with the item
    • postValidate

      public void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions.
      Specified by:
      postValidate in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use if the validation needs to access the database
      context - The current overview context
      node - The node object that represents item
      parentNode - The parent node that is linked with the item
    • postValidateFolder

      public void postValidateFolder(DbControl dc, OverviewContext context, Node folderNode, Node parentNode)
      Call the same method on the parent validator and then on all extension validator actions.
      Specified by:
      postValidateFolder in interface NodeValidator<I>
      Parameters:
      dc - A DbControl to use for database access
      context - The current overview context
      folderNode - The folder node, or null if no folder has been created
      parentNode - The parent node (never null)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValidators

      private Iterable<NodeValidatorAction<I>> getValidators(DbControl dc)