Interface Editor
-
- All Known Subinterfaces:
IndexEditor
,MoveValidator
,Validator
- All Known Implementing Classes:
AtomicCounterEditor
,CompositeEditor
,ConflictValidator
,CrossMountReferenceValidator
,DefaultEditor
,DefaultMoveValidator
,DefaultValidator
,FailingValidator
,IncrementalFlatFileStoreEditor
,IndexUpdate
,MoveAwarePermissionValidator
,MoveDetector
,ProgressNotificationEditor
,SubtreeEditor
,SubtreeExcludingValidator
,SubtreeValidator
,TypeEditor
,VersionableEditor
,VersionablePropertiesEditor
,VisibleEditor
,VisibleValidator
public interface Editor
Content change editor. An editor receives information about changes to the content tree and can reject the changes by throwing aCommitFailedException
or adjust them using theNodeBuilder
instance passed to theEditorProvider
that returned this editor. Note that the given builder can contain updates from multiple different editors, so its state might not match exactly the state of the given after state.- Since:
- Oak 0.7
- See Also:
- Commit editors
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable Editor
childNodeAdded(String name, NodeState after)
Processes an added child node.@Nullable Editor
childNodeChanged(String name, NodeState before, NodeState after)
Processes a changed child node.@Nullable Editor
childNodeDeleted(String name, NodeState before)
Processes a deleted child node.void
enter(NodeState before, NodeState after)
Called before the given before and after states are compared.void
leave(NodeState before, NodeState after)
Called after the given before and after states are compared.void
propertyAdded(PropertyState after)
Processes an added property.void
propertyChanged(PropertyState before, PropertyState after)
Processes a changed property.void
propertyDeleted(PropertyState before)
Processes a removed property.
-
-
-
Method Detail
-
enter
void enter(NodeState before, NodeState after) throws CommitFailedException
Called 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.- 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
void leave(NodeState before, NodeState after) throws CommitFailedException
Called 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.- 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
void propertyAdded(PropertyState after) throws CommitFailedException
Processes an added property.- Parameters:
after
- the added property- Throws:
CommitFailedException
- if processing failed
-
propertyChanged
void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException
Processes a changed property.- Parameters:
before
- the original propertyafter
- the changed property- Throws:
CommitFailedException
- if processing failed
-
propertyDeleted
void propertyDeleted(PropertyState before) throws CommitFailedException
Processes a removed property.- Parameters:
before
- the removed property- Throws:
CommitFailedException
- if processing failed
-
childNodeAdded
@Nullable @Nullable Editor childNodeAdded(String name, NodeState after) throws CommitFailedException
Processes an added child node.- Parameters:
name
- name of the added nodeafter
- the added child node- Returns:
- an editor for processing the subtree below the added node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
childNodeChanged
@Nullable @Nullable Editor childNodeChanged(String name, NodeState before, NodeState after) throws CommitFailedException
Processes a changed child node. This method gets called for all child nodes that may contain changes between the before and after states.- Parameters:
name
- name of the changed nodebefore
- child node before the changeafter
- child node after the change- Returns:
- an editor for processing the subtree below the added node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
childNodeDeleted
@Nullable @Nullable Editor childNodeDeleted(String name, NodeState before) throws CommitFailedException
Processes a deleted child node.- Parameters:
name
- name of the deleted nodebefore
- the deleted child node- Returns:
- an editor for processing the subtree below the removed node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
-