Class CompositeEditor

  • All Implemented Interfaces:
    Editor

    public class CompositeEditor
    extends java.lang.Object
    implements Editor
    Aggregation of a list of editors into a single editor.
    • Constructor Detail

      • CompositeEditor

        public CompositeEditor​(java.util.Collection<? extends Editor> editors)
      • CompositeEditor

        public CompositeEditor​(Editor... editors)
    • Method Detail

      • compose

        @Nullable
        public static @Nullable Editor compose​(@NotNull
                                               @NotNull java.util.Collection<? extends Editor> editors)
      • enter

        public void enter​(NodeState before,
                          NodeState after)
                   throws CommitFailedException
        Description copied from interface: Editor
        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.
        Specified by:
        enter in interface Editor
        Parameters:
        before - before state, non-existent if this node was added
        after - after state, non-existent if this node was removed
        Throws:
        CommitFailedException - if this commit should be rejected
      • leave

        public void leave​(NodeState before,
                          NodeState after)
                   throws CommitFailedException
        Description copied from interface: Editor
        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.
        Specified by:
        leave in interface Editor
        Parameters:
        before - before state, non-existent if this node was added
        after - after state, non-existent if this node was removed
        Throws:
        CommitFailedException - if this commit should be rejected
      • childNodeAdded

        public Editor childNodeAdded​(java.lang.String name,
                                     NodeState after)
                              throws CommitFailedException
        Description copied from interface: Editor
        Processes an added child node.
        Specified by:
        childNodeAdded in interface Editor
        Parameters:
        name - name of the added node
        after - 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

        public Editor childNodeChanged​(java.lang.String name,
                                       NodeState before,
                                       NodeState after)
                                throws CommitFailedException
        Description copied from interface: Editor
        Processes a changed child node. This method gets called for all child nodes that may contain changes between the before and after states.
        Specified by:
        childNodeChanged in interface Editor
        Parameters:
        name - name of the changed node
        before - child node before the change
        after - 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

        public Editor childNodeDeleted​(java.lang.String name,
                                       NodeState before)
                                throws CommitFailedException
        Description copied from interface: Editor
        Processes a deleted child node.
        Specified by:
        childNodeDeleted in interface Editor
        Parameters:
        name - name of the deleted node
        before - 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