Class DiffObserver

  • All Implemented Interfaces:

    public abstract class DiffObserver
    extends java.lang.Object
    implements Observer
    Abstract base class for observers that use a content diff to determine what changed between two consecutive observed states of the repository. Subclasses just need to provide the diff handler by implementing the getRootDiff(NodeState, NodeState, CommitInfo) method.
    • Constructor Detail

      • DiffObserver

        public DiffObserver()
    • Method Detail

      • getRootDiff

        protected abstract NodeStateDiff getRootDiff​(@NotNull
                                                     @NotNull NodeState before,
                                                     @NotNull NodeState after,
                                                     @NotNull CommitInfo info)
        Returns the diff handler to be used for the given content change.
        before - state of the repository before this changes
        after - state of the repository after this changes
        info - local commit information, or null if not available
        diff handler for this change
      • contentChanged

        public final void contentChanged​(@NotNull
                                         @NotNull NodeState root,
                                         @NotNull CommitInfo info)
        Description copied from interface: Observer
        Observes a content change. See the Observer class javadocs and relevant repository and observer registration details for more information on when and how this method gets called.
        Specified by:
        contentChanged in interface Observer
        root - root state of the repository
        info - commit information