Class VisibleValidator
java.lang.Object
org.apache.jackrabbit.oak.spi.commit.VisibleValidator
Validator implementation that allows to exclude hidden nodes and/or properties
for the validation process.
-
Constructor Summary
ConstructorsConstructorDescriptionVisibleValidator(@NotNull Validator validator, boolean hideNodes, boolean hideProperties) -
Method Summary
Modifier and TypeMethodDescription@Nullable ValidatorchildNodeAdded(String name, NodeState after) Validate an added node@Nullable ValidatorchildNodeChanged(String name, NodeState before, NodeState after) Validate a changed node@Nullable ValidatorchildNodeDeleted(String name, NodeState before) Validate a deleted nodevoidCalled before the given before and after states are compared.voidCalled after the given before and after states are compared.voidpropertyAdded(PropertyState after) Validate an added propertyvoidpropertyChanged(PropertyState before, PropertyState after) Validate a changed propertyvoidpropertyDeleted(PropertyState before) Validate a deleted property
-
Constructor Details
-
VisibleValidator
public VisibleValidator(@NotNull @NotNull Validator validator, boolean hideNodes, boolean hideProperties)
-
-
Method Details
-
enter
Description copied from interface:EditorCalled before the given before and after states are compared. The implementation can use this method to initialize any internal state needed for processing the results of the comparison. For example an implementation could look up the effective node type of the after state to know what constraints to apply to on the content changes.- Specified by:
enterin interfaceEditor- Parameters:
before- before state, non-existent if this node was addedafter- after state, non-existent if this node was removed- Throws:
CommitFailedException- if this commit should be rejected
-
leave
Description copied from interface:EditorCalled after the given before and after states are compared. The implementation can use this method to post-process information collected during the content diff. For example an implementation that during the diff just recorded the fact that this node was modified in some way could then use this method to trigger an index update based on that modification flag.- Specified by:
leavein interfaceEditor- Parameters:
before- before state, non-existent if this node was addedafter- after state, non-existent if this node was removed- Throws:
CommitFailedException- if this commit should be rejected
-
propertyAdded
Description copied from interface:ValidatorValidate an added property- Specified by:
propertyAddedin interfaceEditor- Specified by:
propertyAddedin interfaceValidator- Parameters:
after- the added property- Throws:
CommitFailedException- if validation fails.
-
propertyChanged
Description copied from interface:ValidatorValidate a changed property- Specified by:
propertyChangedin interfaceEditor- Specified by:
propertyChangedin interfaceValidator- Parameters:
before- the original propertyafter- the changed property- Throws:
CommitFailedException- if validation fails.
-
propertyDeleted
Description copied from interface:ValidatorValidate a deleted property- Specified by:
propertyDeletedin interfaceEditor- Specified by:
propertyDeletedin interfaceValidator- Parameters:
before- the original property- Throws:
CommitFailedException- if validation fails.
-
childNodeAdded
@Nullable public @Nullable Validator childNodeAdded(String name, NodeState after) throws CommitFailedException Description copied from interface:ValidatorValidate an added node- Specified by:
childNodeAddedin interfaceEditor- Specified by:
childNodeAddedin interfaceValidator- Parameters:
name- the name of the added nodeafter- the added node- Returns:
- a
Validatorforafterornullif validation should not decent into the subtree rooted atafter. - Throws:
CommitFailedException- if validation fails.
-
childNodeChanged
@Nullable public @Nullable Validator childNodeChanged(String name, NodeState before, NodeState after) throws CommitFailedException Description copied from interface:ValidatorValidate a changed node- Specified by:
childNodeChangedin interfaceEditor- Specified by:
childNodeChangedin interfaceValidator- Parameters:
name- the name of the changed nodebefore- the original nodeafter- the changed node- Returns:
- a
Validatorforafterornullif validation should not decent into the subtree rooted atafter. - Throws:
CommitFailedException- if validation fails.
-
childNodeDeleted
@Nullable public @Nullable Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException Description copied from interface:ValidatorValidate a deleted node- Specified by:
childNodeDeletedin interfaceEditor- Specified by:
childNodeDeletedin interfaceValidator- Parameters:
name- The name of the deleted node.before- the original node- Returns:
- a
Validatorfor the removed subtree ornullif validation should not decent into the subtree - Throws:
CommitFailedException- if validation fails.
-