public interface EventHandler
As the content diff recurses down the content tree, it will call the
getChildHandler(String, NodeState, NodeState)
method to
specialize the handler instance for each node under which changes are
detected. The other handler methods always apply to the properties
and direct children of the node for which that handler instance is
specialized. The handler is expected to keep track of contextual
information like the path or identifier of the current node based on
the sequence of those specialization calls.
The events belonging to this instance should be delivered before events to other instance deeper down the tree are delivered.
All names and paths passed to handler methods use unmapped Oak names.
Modifier and Type | Method and Description |
---|---|
void |
enter(NodeState before,
NodeState after)
Called before the given before and after states are compared.
|
@Nullable EventHandler |
getChildHandler(java.lang.String name,
NodeState before,
NodeState after)
Returns a handler of events within the given child node, or
null if changes within that child are not to be processed. |
void |
leave(NodeState before,
NodeState after)
Called after the given before and after states are compared.
|
void |
nodeAdded(java.lang.String name,
NodeState after)
Notification for an added node
|
void |
nodeDeleted(java.lang.String name,
NodeState before)
Notification for a deleted node
|
void |
nodeMoved(java.lang.String sourcePath,
java.lang.String name,
NodeState moved)
Notification for a moved node
|
void |
nodeReordered(java.lang.String destName,
java.lang.String name,
NodeState reordered)
Notification for a reordered node
|
void |
propertyAdded(PropertyState after)
Notification for an added property
|
void |
propertyChanged(PropertyState before,
PropertyState after)
Notification for a changed property
|
void |
propertyDeleted(PropertyState before)
Notification for a deleted property
|
void enter(NodeState before, NodeState after)
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removedvoid leave(NodeState before, NodeState after)
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removed@Nullable @Nullable EventHandler getChildHandler(java.lang.String name, NodeState before, NodeState after)
null
if changes within that child are not to be processed.name
- name of the child nodebefore
- before state of the child node, possibly non-existentafter
- after state of the child node, possibly non-existentnull
void propertyAdded(PropertyState after)
after
- added propertyvoid propertyChanged(PropertyState before, PropertyState after)
before
- property before the changeafter
- property after the changevoid propertyDeleted(PropertyState before)
before
- deleted propertyvoid nodeAdded(java.lang.String name, NodeState after)
name
- name of the nodeafter
- added nodevoid nodeDeleted(java.lang.String name, NodeState before)
name
- name of the deleted nodebefore
- deleted nodevoid nodeMoved(java.lang.String sourcePath, java.lang.String name, NodeState moved)
sourcePath
- source of the moved nodename
- name of the moved nodemoved
- moved nodevoid nodeReordered(java.lang.String destName, java.lang.String name, NodeState reordered)
destName
- name of the orderBefore()
destination nodename
- name of the moved nodereordered
- moved nodeCopyright © 2010 - 2020 Adobe. All Rights Reserved