public class MoveDetector extends java.lang.Object implements Validator
MoveDetector
is a validator that can detect certain move operations
and reports these to the wrapped MoveValidator
by calling
MoveValidator.move(String, String, NodeState)
. That method is called additional
to MoveValidator.childNodeAdded(String, NodeState)
for the destination of the move
operation and MoveValidator.childNodeDeleted(String, NodeState)
for the source of
the move operation.
Detection of move operations relies on the presence of the SOURCE_PATH
property.
New nodes with this property set have been moved from the path indicated by the value of the
property to its current location.
Limitations:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SOURCE_PATH |
Constructor and Description |
---|
MoveDetector(MoveValidator moveValidator) |
Modifier and Type | Method and Description |
---|---|
Validator |
childNodeAdded(java.lang.String name,
NodeState after)
Validate an added node
|
Validator |
childNodeChanged(java.lang.String name,
NodeState before,
NodeState after)
Validate a changed node
|
Validator |
childNodeDeleted(java.lang.String name,
NodeState before)
Validate a deleted node
|
void |
enter(NodeState before,
NodeState after)
Called before the given before and after states are compared.
|
void |
leave(NodeState before,
NodeState after)
Called after the given before and after states are compared.
|
void |
propertyAdded(PropertyState after)
Validate an added property
|
void |
propertyChanged(PropertyState before,
PropertyState after)
Validate a changed property
|
void |
propertyDeleted(PropertyState before)
Validate a deleted property
|
public static final java.lang.String SOURCE_PATH
public MoveDetector(MoveValidator moveValidator)
public void enter(NodeState before, NodeState after) throws CommitFailedException
Editor
enter
in interface Editor
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removedCommitFailedException
- if this commit should be rejectedpublic void leave(NodeState before, NodeState after) throws CommitFailedException
Editor
leave
in interface Editor
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removedCommitFailedException
- if this commit should be rejectedpublic void propertyAdded(PropertyState after) throws CommitFailedException
Validator
propertyAdded
in interface Editor
propertyAdded
in interface Validator
after
- the added propertyCommitFailedException
- if validation fails.public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException
Validator
propertyChanged
in interface Editor
propertyChanged
in interface Validator
before
- the original propertyafter
- the changed propertyCommitFailedException
- if validation fails.public void propertyDeleted(PropertyState before) throws CommitFailedException
Validator
propertyDeleted
in interface Editor
propertyDeleted
in interface Validator
before
- the original propertyCommitFailedException
- if validation fails.public Validator childNodeAdded(java.lang.String name, NodeState after) throws CommitFailedException
Validator
childNodeAdded
in interface Editor
childNodeAdded
in interface Validator
name
- the name of the added nodeafter
- the added nodeValidator
for after
or null
if validation
should not decent into the subtree rooted at after
.CommitFailedException
- if validation fails.public Validator childNodeChanged(java.lang.String name, NodeState before, NodeState after) throws CommitFailedException
Validator
childNodeChanged
in interface Editor
childNodeChanged
in interface Validator
name
- the name of the changed nodebefore
- the original nodeafter
- the changed nodeValidator
for after
or null
if validation
should not decent into the subtree rooted at after
.CommitFailedException
- if validation fails.public Validator childNodeDeleted(java.lang.String name, NodeState before) throws CommitFailedException
Validator
childNodeDeleted
in interface Editor
childNodeDeleted
in interface Validator
name
- The name of the deleted node.before
- the original nodeValidator
for the removed subtree or
null
if validation should not decent into the subtreeCommitFailedException
- if validation fails.Copyright © 2010 - 2020 Adobe. All Rights Reserved