Class NullNodeValidator<I>

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

public class NullNodeValidator<I> extends Object implements NodeValidator<I>
A node validator implementation that accepts all nodes, except missing items and denied access items (depending on configuration). No validation failures are reported.
Version:
2.10
Author:
Nicklas
Last modified
$Date: 2012-04-18 11:37:46 +0200 (on, 18 apr 2012) $
  • Field Details

    • acceptDenied

      private boolean acceptDenied
    • acceptMissing

      private boolean acceptMissing
  • Constructor Details

    • NullNodeValidator

      public NullNodeValidator()
      Create a new validator with default settings.
    • NullNodeValidator

      public NullNodeValidator(boolean acceptDenied, boolean acceptMissing)
      Created a new validator that accepts denied and/or missing nodes.
      Parameters:
      acceptDenied - TRUE to accept denied nodes, FALSE to reject
      acceptMissing - TRUE to accept missing nodes, FALSE to reject
      Since:
      2.17
  • Method Details

    • preDeniedItem

      public boolean preDeniedItem(DbControl dc, OverviewContext context, Node parentNode)
      Description copied from interface: NodeValidator
      Validate an item that the current user doen't have access to before creating a node for it.
      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 / FALSE depening on the acceptDenied setting (default = false).
    • preMissingItem

      public boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
      Description copied from interface: NodeValidator
      Validate a missing item before creating a node for it. This usually means creating a missing item Failure for the parent node and registering it with the context.
      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 / FALSE depening on the acceptMissing setting (default = false).
    • preValidate

      public boolean preValidate(DbControl dc, OverviewContext context, I item, Node parentNode)
      Description copied from interface: NodeValidator
      Validate an existing item before creating a node for it.
      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:
      Always true
    • postMissingItem

      public void postMissingItem(DbControl dc, OverviewContext context, Node node, Node parentNode)
      Do nothing.
      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)
      Do nothing.
      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)
      Do nothing.
      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)
      Do nothing.
      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)