Class SubtreeValidator
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.commit.DefaultValidator
-
- org.apache.jackrabbit.oak.spi.commit.SubtreeValidator
-
public class SubtreeValidator extends DefaultValidator
Validator that detects changes to a specified subtree and delegates the validation of such changes to another given validator.- Since:
- Oak 0.3
- See Also:
SubtreeExcludingValidator
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description SubtreeValidator(Validator validator, java.lang.String... path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Validator
childNodeAdded(java.lang.String name, NodeState after)
Validate an added nodeValidator
childNodeChanged(java.lang.String name, NodeState before, NodeState after)
Validate a changed nodeValidator
childNodeDeleted(java.lang.String name, NodeState before)
Validate a deleted node-
Methods inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
enter, leave, propertyAdded, propertyChanged, propertyDeleted
-
-
-
-
Constructor Detail
-
SubtreeValidator
public SubtreeValidator(Validator validator, java.lang.String... path)
-
-
Method Detail
-
childNodeAdded
public Validator childNodeAdded(java.lang.String name, NodeState after)
Description copied from interface:Validator
Validate an added node- Specified by:
childNodeAdded
in interfaceEditor
- 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
.
-
childNodeChanged
public Validator childNodeChanged(java.lang.String name, NodeState before, NodeState after)
Description copied from interface:Validator
Validate a changed node- Specified by:
childNodeChanged
in interfaceEditor
- 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
.
-
childNodeDeleted
public Validator childNodeDeleted(java.lang.String name, NodeState before)
Description copied from interface:Validator
Validate a deleted node- Specified by:
childNodeDeleted
in interfaceEditor
- 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
-
-