public abstract class AbstractMutableTree extends org.apache.jackrabbit.oak.plugins.tree.AbstractTree
AbstractMutableTree
extends AbstractTree
with implementations
for most write methods of Tree
. Furthermore it handles the ordering
of siblings.org.apache.jackrabbit.oak.api.Tree.Status
name, nodeBuilder
EMPTY_ARRAY, GET_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractMutableTree(String name,
org.apache.jackrabbit.oak.spi.state.NodeBuilder nodeBuilder) |
Modifier and Type | Method and Description |
---|---|
org.apache.jackrabbit.oak.api.Tree |
addChild(String name) |
org.apache.jackrabbit.oak.api.Tree |
getChild(String name) |
protected abstract org.apache.jackrabbit.oak.spi.state.NodeBuilder |
getNodeBuilder() |
AbstractMutableTree |
getParent() |
protected abstract AbstractMutableTree |
getParentOrNull() |
boolean |
orderBefore(String name) |
boolean |
remove() |
void |
removeProperty(String name) |
void |
setOrderableChildren(boolean enable) |
void |
setProperty(org.apache.jackrabbit.oak.api.PropertyState property) |
<T> void |
setProperty(String name,
T value) |
<T> void |
setProperty(String name,
T value,
org.apache.jackrabbit.oak.api.Type<T> type) |
protected void |
updateChildOrder(boolean force)
Updates the child order to match any added or removed child nodes that
are not yet reflected in the
TreeConstants.OAK_CHILD_ORDER
property. |
buildPath, createChild, exists, getChildNames, getChildren, getChildrenCount, getName, getNodeState, getPath, getProperties, getProperty, getPropertyCount, getPropertyStatus, getStatus, hasChild, hasOrderableChildren, hasProperty, isModified, isNew, isRoot, toString
protected AbstractMutableTree(@Nonnull String name, @Nonnull org.apache.jackrabbit.oak.spi.state.NodeBuilder nodeBuilder)
protected abstract AbstractMutableTree getParentOrNull()
protected abstract org.apache.jackrabbit.oak.spi.state.NodeBuilder getNodeBuilder()
@Nonnull public AbstractMutableTree getParent()
getParent
in interface org.apache.jackrabbit.oak.api.Tree
getParent
in class org.apache.jackrabbit.oak.plugins.tree.AbstractTree
@Nonnull public org.apache.jackrabbit.oak.api.Tree getChild(@Nonnull String name) throws IllegalArgumentException
IllegalArgumentException
public boolean remove()
@Nonnull public org.apache.jackrabbit.oak.api.Tree addChild(@Nonnull String name) throws IllegalArgumentException
IllegalArgumentException
public void setOrderableChildren(boolean enable)
protected void updateChildOrder(boolean force)
TreeConstants.OAK_CHILD_ORDER
property. If the force
flag is set, the child order is set
in any case, otherwise only if the node already is orderable.force
- whether to add child order information if it doesn't existpublic void setProperty(@Nonnull org.apache.jackrabbit.oak.api.PropertyState property)
public <T> void setProperty(@Nonnull String name, @Nonnull T value) throws IllegalArgumentException
IllegalArgumentException
public <T> void setProperty(@Nonnull String name, @Nonnull T value, @Nonnull org.apache.jackrabbit.oak.api.Type<T> type) throws IllegalArgumentException
IllegalArgumentException
Copyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.