public class TypeEditor extends DefaultEditor
Modifier and Type | Class and Description |
---|---|
static interface |
TypeEditor.ConstraintViolationCallback
Extension point that allows pluggable handling of constraint violations
|
Modifier and Type | Field and Description |
---|---|
static TypeEditor.ConstraintViolationCallback |
THROW_ON_CONSTRAINT_VIOLATION |
static TypeEditor.ConstraintViolationCallback |
WARN_ON_CONSTRAINT_VIOLATION |
INSTANCE
Modifier and Type | Method and Description |
---|---|
Editor |
childNodeAdded(java.lang.String name,
NodeState after)
Processes an added child node.
|
TypeEditor |
childNodeChanged(java.lang.String name,
NodeState before,
NodeState after)
Processes a changed child node.
|
Editor |
childNodeDeleted(java.lang.String name,
NodeState before)
Processes a deleted child node.
|
static TypeEditor |
create(@NotNull TypeEditor.ConstraintViolationCallback callback,
java.util.Set<java.lang.String> typesToCheck,
@NotNull NodeState types,
java.lang.String primary,
java.lang.Iterable<java.lang.String> mixins,
@NotNull NodeBuilder builder)
Creates a new TypeEditor instance
|
void |
enter(NodeState before,
NodeState after)
Called before the given before and after states are compared.
|
void |
propertyAdded(PropertyState after)
Processes an added property.
|
void |
propertyChanged(PropertyState before,
PropertyState after)
Processes a changed property.
|
void |
propertyDeleted(PropertyState before)
Processes a removed property.
|
leave
public static final TypeEditor.ConstraintViolationCallback THROW_ON_CONSTRAINT_VIOLATION
public static final TypeEditor.ConstraintViolationCallback WARN_ON_CONSTRAINT_VIOLATION
public static TypeEditor create(@NotNull @NotNull TypeEditor.ConstraintViolationCallback callback, java.util.Set<java.lang.String> typesToCheck, @NotNull @NotNull NodeState types, java.lang.String primary, java.lang.Iterable<java.lang.String> mixins, @NotNull @NotNull NodeBuilder builder) throws CommitFailedException
callback
- the callback to use when a constraint violation is found. The client must
check the results of the callback invocations if the specified callback does not
immediately propagate constraint violations as checked exceptions.typesToCheck
- the types to check for. If null
, this node is checked. Otherwise
it is checked if its primary type or one of it's mixin types is contained in this parameterstypes
- the /jcr:system/jcr:nodeTypes
nodeprimary
- the node's primary typemixins
- the node's mixinsbuilder
- a builder containing the current state of the node to check. May be used to set
a default primary type if none is setCommitFailedException
- when the primary type of mixin definition is incorrectpublic void propertyAdded(PropertyState after) throws CommitFailedException
Editor
propertyAdded
in interface Editor
propertyAdded
in class DefaultEditor
after
- the added propertyCommitFailedException
- if processing failedpublic void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException
Editor
propertyChanged
in interface Editor
propertyChanged
in class DefaultEditor
before
- the original propertyafter
- the changed propertyCommitFailedException
- if processing failedpublic void propertyDeleted(PropertyState before) throws CommitFailedException
Editor
propertyDeleted
in interface Editor
propertyDeleted
in class DefaultEditor
before
- the removed propertyCommitFailedException
- if processing failedpublic void enter(NodeState before, NodeState after) throws CommitFailedException
Editor
enter
in interface Editor
enter
in class DefaultEditor
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 Editor childNodeAdded(java.lang.String name, NodeState after) throws CommitFailedException
Editor
childNodeAdded
in interface Editor
childNodeAdded
in class DefaultEditor
name
- name of the added nodeafter
- the added child nodenull
if the subtree does not need processingCommitFailedException
- if processing failedpublic TypeEditor childNodeChanged(java.lang.String name, NodeState before, NodeState after) throws CommitFailedException
Editor
childNodeChanged
in interface Editor
childNodeChanged
in class DefaultEditor
name
- name of the changed nodebefore
- child node before the changeafter
- child node after the changenull
if the subtree does not need processingCommitFailedException
- if processing failedpublic Editor childNodeDeleted(java.lang.String name, NodeState before) throws CommitFailedException
Editor
childNodeDeleted
in interface Editor
childNodeDeleted
in class DefaultEditor
name
- name of the deleted nodebefore
- the deleted child nodenull
if the subtree does not need processingCommitFailedException
- if processing failedCopyright © 2010 - 2020 Adobe. All Rights Reserved