public abstract class ReadOnlyNodeTypeManager extends Object implements NodeTypeManager, EffectiveNodeTypeProvider, DefinitionProvider
NodeTypeManager with support for reading
node types from the Tree returned by getTypes(). Methods
related to node type modifications throw
UnsupportedRepositoryOperationException.| Constructor and Description |
|---|
ReadOnlyNodeTypeManager() |
| Modifier and Type | Method and Description |
|---|---|
NodeDefinitionTemplate |
createNodeDefinitionTemplate() |
NodeTypeTemplate |
createNodeTypeTemplate() |
NodeTypeTemplate |
createNodeTypeTemplate(NodeTypeDefinition ntd) |
PropertyDefinitionTemplate |
createPropertyDefinitionTemplate() |
NodeTypeIterator |
getAllNodeTypes() |
@NotNull PropertyDefinition |
getDefinition(@NotNull Tree parent,
@NotNull PropertyState property,
boolean exactTypeMatch)
Calculates the applicable definition for the property state under the
given parent tree.
|
@NotNull NodeDefinition |
getDefinition(@NotNull Tree parent,
@NotNull String nodeName)
Returns the node definition for a child node of
parent named
nodeName with a default primary type. |
@NotNull NodeDefinition |
getDefinition(@NotNull Tree parent,
@NotNull Tree targetNode)
Calculates the applicable definition for the child node under the given
parent node.
|
@NotNull EffectiveNodeType |
getEffectiveNodeType(@NotNull Node node)
Returns all the node types of the given node, in a breadth-first
traversal order of the type hierarchy.
|
@NotNull EffectiveNodeType |
getEffectiveNodeType(@NotNull Tree tree)
Calculates and returns the effective node types of the given tree.
|
static @NotNull ReadOnlyNodeTypeManager |
getInstance(Root root,
NamePathMapper namePathMapper)
Return a new instance of
ReadOnlyNodeTypeManager that reads node
type information from the tree at NodeTypeConstants.NODE_TYPES_PATH. |
NodeTypeIterator |
getMixinNodeTypes() |
NodeType |
getNodeType(String name) |
NodeTypeIterator |
getPrimaryNodeTypes() |
@NotNull NodeDefinition |
getRootDefinition() |
boolean |
hasNodeType(String name) |
boolean |
isNodeType(@Nullable String primaryTypeName,
@NotNull Iterable<String> mixinTypes,
@NotNull String nodeTypeName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(@NotNull String typeName,
@NotNull String superName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(@NotNull Tree tree,
@NotNull String oakNtName)
Returns
true if this tree is of the specified primary node
type or mixin type, or a subtype thereof respecting the effective node
type of the tree. |
NodeType |
registerNodeType(NodeTypeDefinition ntd,
boolean allowUpdate)
This implementation always throws a
UnsupportedRepositoryOperationException. |
NodeTypeIterator |
registerNodeTypes(NodeTypeDefinition[] ntds,
boolean allowUpdate)
This implementation always throws a
UnsupportedRepositoryOperationException. |
void |
unregisterNodeType(String name)
This implementation always throws a
UnsupportedRepositoryOperationException. |
void |
unregisterNodeTypes(String[] names)
This implementation always throws a
UnsupportedRepositoryOperationException. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisNodeType@NotNull public static @NotNull ReadOnlyNodeTypeManager getInstance(Root root, NamePathMapper namePathMapper)
ReadOnlyNodeTypeManager that reads node
type information from the tree at NodeTypeConstants.NODE_TYPES_PATH.root - The root to read node types from.namePathMapper - The NamePathMapper to use.ReadOnlyNodeTypeManager.public boolean hasNodeType(String name) throws RepositoryException
hasNodeType in interface NodeTypeManagerRepositoryExceptionpublic NodeType getNodeType(String name) throws RepositoryException
getNodeType in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator getAllNodeTypes() throws RepositoryException
getAllNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
getPrimaryNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException
createNodeTypeTemplate in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws RepositoryException
createNodeTypeTemplate in interface NodeTypeManagerRepositoryExceptionpublic NodeDefinitionTemplate createNodeDefinitionTemplate() throws RepositoryException
createNodeDefinitionTemplate in interface NodeTypeManagerRepositoryExceptionpublic PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws RepositoryException
createPropertyDefinitionTemplate in interface NodeTypeManagerRepositoryExceptionpublic NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException.registerNodeType in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException.registerNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic void unregisterNodeType(String name) throws RepositoryException
UnsupportedRepositoryOperationException.unregisterNodeType in interface NodeTypeManagerRepositoryExceptionpublic void unregisterNodeTypes(String[] names) throws RepositoryException
UnsupportedRepositoryOperationException.unregisterNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic boolean isNodeType(@NotNull
@NotNull Tree tree,
@NotNull
@NotNull String oakNtName)
EffectiveNodeTypeProvidertrue if this tree is of the specified primary node
type or mixin type, or a subtype thereof respecting the effective node
type of the tree. Returns false otherwise.
Note: caution must be taken while calling this api because it doesn't
offer the same strict guarantees as the Node#isNodeType(String)
method in the case where the session doesn't have access to the
jcr:mixinTypes property.isNodeType in interface EffectiveNodeTypeProvidertree - The tree to be tested.oakNtName - The internal oak name of the node type to be tested.public boolean isNodeType(@Nullable
@Nullable String primaryTypeName,
@NotNull
@NotNull Iterable<String> mixinTypes,
@NotNull
@NotNull String nodeTypeName)
EffectiveNodeTypeProvidertrue if typeName is of the specified primary node
type or mixin type, or a subtype thereof. Returns false otherwise.isNodeType in interface EffectiveNodeTypeProviderprimaryTypeName - the internal oak name of the node to testmixinTypes - the internal oak names of the node to test.nodeTypeName - The internal oak name of the node type to be tested.true if the specified node type is of the given node type.public boolean isNodeType(@NotNull
@NotNull String typeName,
@NotNull
@NotNull String superName)
EffectiveNodeTypeProvidertrue if typeName is of the specified primary node
type or mixin type, or a subtype thereof. Returns false otherwise.isNodeType in interface EffectiveNodeTypeProvidertypeName - the internal oak name of the node type to testsuperName - The internal oak name of the super type to be tested for.true if the specified node type is of the given node type.@NotNull public @NotNull EffectiveNodeType getEffectiveNodeType(@NotNull @NotNull Node node) throws RepositoryException
getEffectiveNodeType in interface EffectiveNodeTypeProvidernode - node instanceRepositoryException - if the type information can not be accessed@NotNull public @NotNull EffectiveNodeType getEffectiveNodeType(@NotNull @NotNull Tree tree) throws RepositoryException
EffectiveNodeTypeProvidergetEffectiveNodeType in interface EffectiveNodeTypeProvidertree - the treeRepositoryException - if the type information can not be accessed,@NotNull public @NotNull NodeDefinition getRootDefinition() throws RepositoryException
getRootDefinition in interface DefinitionProviderRepositoryException@NotNull public @NotNull NodeDefinition getDefinition(@NotNull @NotNull Tree parent, @NotNull @NotNull String nodeName) throws RepositoryException
DefinitionProviderparent named
nodeName with a default primary type. First the non-residual
child node definitions of parent are checked matching the
given node name. Then the residual definitions are checked.getDefinition in interface DefinitionProviderparent - the parent node.nodeName - The internal oak name of the child node.ConstraintViolationException - If no matching definition can be found.RepositoryException - If another error occurs.@NotNull public @NotNull NodeDefinition getDefinition(@NotNull @NotNull Tree parent, @NotNull @NotNull Tree targetNode) throws RepositoryException
DefinitionProvidergetDefinition in interface DefinitionProviderparent - The parent node.targetNode - The child node for which the definition is calculated.ConstraintViolationException - If no matching definition can be found.RepositoryException - If another error occurs.@NotNull public @NotNull PropertyDefinition getDefinition(@NotNull @NotNull Tree parent, @NotNull @NotNull PropertyState property, boolean exactTypeMatch) throws RepositoryException
DefinitionProvidergetDefinition in interface DefinitionProviderparent - The parent tree.property - The target property.ConstraintViolationException - If no matching definition can be found.RepositoryException - If another error occurs.Copyright © 2010 - 2020 Adobe. All Rights Reserved