@CheckForNull public static String getPrimaryTypeName(@Nonnull org.apache.jackrabbit.oak.api.Tree tree)
@CheckForNull public static Iterable<String> getStrings(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String propertyName)
@CheckForNull public static String getString(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String propertyName)
@CheckForNull public static String getString(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String name, @Nullable String defaultValue)
public static boolean getBoolean(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull 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.@CheckForNull public static String getName(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String name)
@Nonnull public static Iterable<String> getNames(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String name)
public static long getLong(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String name, long defaultValue)
@CheckForNull public static org.apache.jackrabbit.oak.api.Tree getTree(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull 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 nullpublic static org.apache.jackrabbit.oak.api.Tree addChild(@Nonnull org.apache.jackrabbit.oak.api.Tree parent, @Nonnull String name, @CheckForNull String typeName, @Nonnull org.apache.jackrabbit.oak.api.Tree typeRoot, @CheckForNull String userID) throws RepositoryException
RepositoryException@Nonnull public static org.apache.jackrabbit.oak.api.Tree addChild(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String childName, @Nonnull String primaryTypeName) throws AccessDeniedException
Tree.addChild(String) and
Tree.setProperty(String, Object, org.apache.jackrabbit.oak.api.Type)
where the property name is JcrConstants.JCR_PRIMARYTYPE.
Note, that this method in addition verifies if the created tree exists
and is accessible in order to avoid IllegalStateException upon
subsequent modification of the new child.childName - The Oak name of the child item.primaryTypeName - The Oak name of the primary node type.AccessDeniedException - If the child does not exist after creation.@Nonnull public static org.apache.jackrabbit.oak.api.Tree getOrAddChild(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String childName, @Nonnull String primaryTypeName) throws AccessDeniedException
Tree.getChild(String) and adding a child including
its jcr:primaryType property (i.e. Tree.addChild(String) and
Tree.setProperty(PropertyState)) in case no tree exists with the specified name.childName - The Oak name of the child item.primaryTypeName - The Oak name of the primary node type.AccessDeniedException - If the child does not exist after creation.public static void addMixin(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull String mixinName, @Nonnull org.apache.jackrabbit.oak.api.Tree typeRoot, @CheckForNull String userID) throws RepositoryException
RepositoryExceptionpublic static void autoCreateItems(@Nonnull org.apache.jackrabbit.oak.api.Tree tree, @Nonnull org.apache.jackrabbit.oak.api.Tree type, @Nonnull org.apache.jackrabbit.oak.api.Tree typeRoot, @CheckForNull String userID) throws RepositoryException
RepositoryExceptionpublic static org.apache.jackrabbit.oak.api.PropertyState autoCreateProperty(@Nonnull String name, @Nonnull org.apache.jackrabbit.oak.api.Tree definition, @CheckForNull String userID)
public static String getDefaultChildType(org.apache.jackrabbit.oak.api.Tree typeRoot, org.apache.jackrabbit.oak.api.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<org.apache.jackrabbit.oak.api.Tree> getEffectiveType(org.apache.jackrabbit.oak.api.Tree tree, org.apache.jackrabbit.oak.api.Tree typeRoot)
public static String findDefaultPrimaryType(org.apache.jackrabbit.oak.api.Tree definitions, boolean sns)
public static boolean isNodeType(org.apache.jackrabbit.oak.api.Tree tree, String typeName, org.apache.jackrabbit.oak.api.Tree typeRoot)
public static boolean isReadOnlyTree(@Nonnull org.apache.jackrabbit.oak.api.Tree tree)
true if the specified tree is a read-only tree..tree - The tree object to be tested.true if the specified tree is an immutable read-only tree.ReadOnlyCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.