Class DefaultMoveValidator
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.commit.DefaultValidator
-
- org.apache.jackrabbit.oak.spi.commit.DefaultMoveValidator
-
- All Implemented Interfaces:
Editor
,Validator
,MoveValidator
public class DefaultMoveValidator extends DefaultValidator implements MoveValidator
MoveValidator
that does nothing by default and doesn't recurse into subtrees. Useful as a sentinel or as a base class for more complex validators.- See Also:
DefaultValidator
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description DefaultMoveValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MoveValidator
childNodeAdded(java.lang.String name, NodeState after)
Validate an added nodeMoveValidator
childNodeChanged(java.lang.String name, NodeState before, NodeState after)
Validate a changed nodeMoveValidator
childNodeDeleted(java.lang.String name, NodeState before)
Validate a deleted nodevoid
move(java.lang.String name, java.lang.String sourcePath, NodeState moved)
Called when a moved node has been detected.-
Methods inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
enter, leave, propertyAdded, propertyChanged, propertyDeleted
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.spi.commit.Validator
propertyAdded, propertyChanged, propertyDeleted
-
-
-
-
Method Detail
-
move
public void move(java.lang.String name, java.lang.String sourcePath, NodeState moved) throws CommitFailedException
Description copied from interface:MoveValidator
Called when a moved node has been detected.- Specified by:
move
in interfaceMoveValidator
- Parameters:
name
- name of the node after the movesourcePath
- path of the node before the movemoved
- the node state moved here- Throws:
CommitFailedException
- if validation fails. remove
-
childNodeAdded
public MoveValidator childNodeAdded(java.lang.String name, NodeState after) throws CommitFailedException
Description copied from interface:Validator
Validate an added node- Specified by:
childNodeAdded
in interfaceEditor
- Specified by:
childNodeAdded
in interfaceMoveValidator
- Specified by:
childNodeAdded
in interfaceValidator
- Overrides:
childNodeAdded
in classDefaultValidator
- Parameters:
name
- the name of the added nodeafter
- the added node- Returns:
- a
Validator
forafter
ornull
if validation should not decent into the subtree rooted atafter
. - Throws:
CommitFailedException
- if validation fails.
-
childNodeChanged
public MoveValidator childNodeChanged(java.lang.String name, NodeState before, NodeState after) throws CommitFailedException
Description copied from interface:Validator
Validate a changed node- Specified by:
childNodeChanged
in interfaceEditor
- Specified by:
childNodeChanged
in interfaceMoveValidator
- Specified by:
childNodeChanged
in interfaceValidator
- Overrides:
childNodeChanged
in classDefaultValidator
- Parameters:
name
- the name of the changed nodebefore
- the original nodeafter
- the changed node- Returns:
- a
Validator
forafter
ornull
if validation should not decent into the subtree rooted atafter
. - Throws:
CommitFailedException
- if validation fails.
-
childNodeDeleted
public MoveValidator childNodeDeleted(java.lang.String name, NodeState before) throws CommitFailedException
Description copied from interface:Validator
Validate a deleted node- Specified by:
childNodeDeleted
in interfaceEditor
- Specified by:
childNodeDeleted
in interfaceMoveValidator
- Specified by:
childNodeDeleted
in interfaceValidator
- Overrides:
childNodeDeleted
in classDefaultValidator
- Parameters:
name
- The name of the deleted node.before
- the original node- Returns:
- a
Validator
for the removed subtree ornull
if validation should not decent into the subtree - Throws:
CommitFailedException
- if validation fails.
-
-