Class EditorHook

  • All Implemented Interfaces:
    CommitHook

    public class EditorHook
    extends java.lang.Object
    implements CommitHook
    This commit hook implementation processes changes to be committed using the Editor instance provided by the EditorProvider passed to the constructor.
    Since:
    Oak 0.7
    See Also:
    Commit editors
    • Constructor Detail

      • EditorHook

        public EditorHook​(@NotNull
                          @NotNull EditorProvider provider)
    • Method Detail

      • processCommit

        @NotNull
        public @NotNull NodeState processCommit​(@NotNull
                                                @NotNull NodeState before,
                                                @NotNull
                                                @NotNull NodeState after,
                                                @NotNull
                                                @NotNull CommitInfo info)
                                         throws CommitFailedException
        Description copied from interface: CommitHook
        Validates and/or modifies the given content change before it gets persisted.
        Specified by:
        processCommit in interface CommitHook
        Parameters:
        before - content tree before the commit
        after - content tree prepared for the commit
        info - metadata associated with this commit
        Returns:
        content tree to be committed
        Throws:
        CommitFailedException - if the commit should be rejected
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object