Class ExtensionNodeValidator<I>
java.lang.Object
net.sf.basedb.util.overview.validator.ExtensionNodeValidator<I>
- All Implemented Interfaces:
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 Summary
Modifier and TypeFieldDescriptionprivate final Object
private final NodeValidator<I>
private List<NodeValidatorAction<I>>
-
Constructor Summary
ConstructorDescriptionExtensionNodeValidator
(NodeValidator<I> parent, Object key) Wrap the given parent node validator. -
Method Summary
Modifier and TypeMethodDescriptionprivate Iterable<NodeValidatorAction<I>>
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.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.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.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.boolean
preDeniedItem
(DbControl dc, OverviewContext context, Node parentNode) Call the same method on the parent validator and then on all extension validator actions.boolean
preMissingItem
(DbControl dc, OverviewContext context, Node parentNode) Call the same method on the parent validator and then on all extension validator actions.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.toString()
-
Field Details
-
parent
-
key
-
xtValidators
-
-
Constructor Details
-
ExtensionNodeValidator
Wrap the given parent node validator.
-
-
Method Details
-
preMissingItem
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 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 if a node should be created, FALSE if not
-
preDeniedItem
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 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 if a node should be created, FALSE if not
-
preValidate
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 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:
- TRUE if a node should be created, FALSE if not
-
postMissingItem
Call the same method on the parent validator and then on all extension validator actions.- 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
Call the same method on the parent validator and then on all extension validator actions.- 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
Call the same method on the parent validator and then on all extension validator actions.- 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) Call the same method on the parent validator and then on all extension validator actions.- 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)
-
toString
-
getValidators
-