public final class TreeUtil extends Object
Tree
that are not provided
by the API.Modifier and Type | Method and Description |
---|---|
static Tree |
addChild(Tree parent,
String name,
String typeName,
Tree typeRoot,
String userID) |
static void |
addMixin(Tree tree,
String mixinName,
Tree typeRoot,
String userID) |
static void |
autoCreateItems(Tree tree,
Tree type,
Tree typeRoot,
String userID) |
static PropertyState |
autoCreateProperty(String name,
Tree definition,
String userID) |
static String |
findDefaultPrimaryType(Tree definitions,
boolean sns) |
static boolean |
getBoolean(Tree tree,
String propertyName)
Returns the boolean representation of the property with the specified
propertyName . |
static String |
getDefaultChildType(Tree typeRoot,
Tree parent,
String childName)
Finds the default primary type for a new child node with the given name.
|
static List<Tree> |
getEffectiveType(Tree tree,
Tree typeRoot)
Returns the effective node types of the given node.
|
static String |
getName(Tree tree,
String name) |
static Iterable<String> |
getNames(Tree tree,
String name) |
static String |
getPrimaryTypeName(Tree tree) |
static String |
getString(Tree tree,
String propertyName) |
static Iterable<String> |
getStrings(Tree tree,
String propertyName) |
static Tree |
getTree(Tree tree,
String path)
Return the possibly non existing tree located at the passed
path from
the location of the start tree or null if path results
in a parent of the root. |
static boolean |
isNodeType(Tree tree,
String typeName,
Tree typeRoot) |
static boolean |
isReadOnlyTree(Tree tree)
Returns
true if the specified tree is a read-only tree
such as obtained through TreeFactory
or a read-only Root . |
public static boolean getBoolean(Tree tree, String propertyName)
propertyName
. If the property does not exist or
is an array
this method returns false
.tree
- The target tree.propertyName
- The name of the property.false
if the property does not exist
or is an multivalued property.public static Tree getTree(Tree tree, String path)
path
from
the location of the start tree
or null
if path
results
in a parent of the root.tree
- start treepath
- path from the start treepath
from start
or null
public static Tree addChild(Tree parent, String name, String typeName, Tree typeRoot, String userID) throws RepositoryException
RepositoryException
public static void addMixin(Tree tree, String mixinName, Tree typeRoot, String userID) throws RepositoryException
RepositoryException
public static void autoCreateItems(Tree tree, Tree type, Tree typeRoot, String userID) throws RepositoryException
RepositoryException
public static PropertyState autoCreateProperty(String name, Tree definition, String userID)
public static String getDefaultChildType(Tree typeRoot, Tree parent, String childName)
typeRoot
- root of the /jcr:system/jcr:nodeTypes
treeparent
- parent nodechildName
- name of the new child nodenull
if not availablepublic static List<Tree> getEffectiveType(Tree tree, Tree typeRoot)
public static boolean isReadOnlyTree(Tree tree)
true
if the specified tree
is a read-only tree
such as obtained through TreeFactory
or a read-only Root
.tree
- The tree object to be tested.true
if the specified tree is an immutable read-only tree.TreeFactory.createReadOnlyTree(org.apache.jackrabbit.oak.spi.state.NodeState)
,
RootFactory.createReadOnlyRoot(org.apache.jackrabbit.oak.spi.state.NodeState)
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"