Class NullNodeValidator<I>
java.lang.Object
net.sf.basedb.util.overview.validator.NullNodeValidator<I>
- All Implemented Interfaces:
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 Summary
-
Constructor Summary
ConstructorDescriptionCreate a new validator with default settings.NullNodeValidator
(boolean acceptDenied, boolean acceptMissing) Created a new validator that accepts denied and/or missing nodes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
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 rejectacceptMissing
- TRUE to accept missing nodes, FALSE to reject- Since:
- 2.17
-
-
Method Details
-
preDeniedItem
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 interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextparentNode
- The parent node that is linked with the item- Returns:
- TRUE / FALSE depening on the acceptDenied setting (default = false).
-
preMissingItem
Description copied from interface:NodeValidator
Validate a missing item before creating a node for it. This usually means creating a missing itemFailure
for the parent node and registering it with the context.- Specified by:
preMissingItem
in interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextparentNode
- The parent node that is missing the item- Returns:
- TRUE / FALSE depening on the acceptMissing setting (default = false).
-
preValidate
Description copied from interface:NodeValidator
Validate an existing item before creating a node for it.- Specified by:
preValidate
in interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextitem
- The item to validateparentNode
- The parent node that is linked with the item- Returns:
- Always true
-
postMissingItem
Do nothing.- Specified by:
postMissingItem
in interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextnode
- The node object that represents the missing itemparentNode
- The parent node that is missing the item
-
postDeniedItem
Do nothing.- Specified by:
postDeniedItem
in interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextnode
- The node object that represents the unaccessible itemparentNode
- The parent node that is linked with the item
-
postValidate
Do nothing.- Specified by:
postValidate
in interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextnode
- The node object that represents itemparentNode
- 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 interfaceNodeValidator<I>
- Parameters:
dc
- A DbControl to use for database accesscontext
- The current overview contextfolderNode
- The folder node, or null if no folder has been createdparentNode
- The parent node (never null)
-