2.17.2: 2011-06-17

net.sf.basedb.util.overview.validator
Class NullNodeValidator<I>

java.lang.Object
  extended by 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: 2010-11-18 08:26:30 +0100 (Thu, 18 Nov 2010) $

Field Summary
private  boolean acceptDenied
           
private  boolean acceptMissing
           
 
Constructor Summary
NullNodeValidator()
          Create a new validator with default settings.
NullNodeValidator(boolean acceptDenied, boolean acceptMissing)
          Created a new validator that accepts denied and/or missing nodes.
 
Method Summary
 void postDeniedItem(DbControl dc, OverviewContext context, Node node, Node parentNode)
          Do nothing.
 void postMissingItem(DbControl dc, OverviewContext context, Node node, Node parentNode)
          Do nothing.
 void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
          Do nothing.
 void postValidateFolder(DbControl dc, OverviewContext context, Node folderNode, Node parentNode)
          Do nothing.
 boolean preDeniedItem(DbControl dc, OverviewContext context, Node parentNode)
          Validate an item that the current user doen't have access to before creating a node for it.
 boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
          Validate a missing item before creating a node for it.
 boolean preValidate(DbControl dc, OverviewContext context, I item, Node parentNode)
          Validate an existing item before creating a node for it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acceptDenied

private boolean acceptDenied

acceptMissing

private boolean acceptMissing
Constructor Detail

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 Detail

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)

2.17.2: 2011-06-17