Class DefaultEventHandler

  • All Implemented Interfaces:
    EventHandler
    Direct Known Subclasses:
    FilteredHandler

    public class DefaultEventHandler
    extends java.lang.Object
    implements EventHandler
    Default implementation of EventHandler that does nothing.
    • Constructor Detail

      • DefaultEventHandler

        public DefaultEventHandler()
    • Method Detail

      • enter

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

        public void leave​(NodeState before,
                          NodeState after)
        Description copied from interface: EventHandler
        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.
        Specified by:
        leave in interface EventHandler
        Parameters:
        before - before state, non-existent if this node was added
        after - after state, non-existent if this node was removed
      • getChildHandler

        public EventHandler getChildHandler​(java.lang.String name,
                                            NodeState before,
                                            NodeState after)
        Description copied from interface: EventHandler
        Returns a handler of events within the given child node, or null if changes within that child are not to be processed.
        Specified by:
        getChildHandler in interface EventHandler
        Parameters:
        name - name of the child node
        before - before state of the child node, possibly non-existent
        after - after state of the child node, possibly non-existent
        Returns:
        this
      • nodeAdded

        public void nodeAdded​(java.lang.String name,
                              NodeState after)
        Description copied from interface: EventHandler
        Notification for an added node
        Specified by:
        nodeAdded in interface EventHandler
        Parameters:
        name - name of the node
        after - added node
      • nodeDeleted

        public void nodeDeleted​(java.lang.String name,
                                NodeState before)
        Description copied from interface: EventHandler
        Notification for a deleted node
        Specified by:
        nodeDeleted in interface EventHandler
        Parameters:
        name - name of the deleted node
        before - deleted node
      • nodeMoved

        public void nodeMoved​(java.lang.String sourcePath,
                              java.lang.String name,
                              NodeState moved)
        Description copied from interface: EventHandler
        Notification for a moved node
        Specified by:
        nodeMoved in interface EventHandler
        Parameters:
        sourcePath - source of the moved node
        name - name of the moved node
        moved - moved node
      • nodeReordered

        public void nodeReordered​(java.lang.String destName,
                                  java.lang.String name,
                                  NodeState reordered)
        Description copied from interface: EventHandler
        Notification for a reordered node
        Specified by:
        nodeReordered in interface EventHandler
        Parameters:
        destName - name of the orderBefore() destination node
        name - name of the moved node
        reordered - moved node