public abstract class ReadOnlyNodeTypeManager extends java.lang.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 java.lang.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(java.lang.String name) |
NodeTypeIterator |
getPrimaryNodeTypes() |
@NotNull NodeDefinition |
getRootDefinition() |
boolean |
hasNodeType(java.lang.String name) |
boolean |
isNodeType(@Nullable java.lang.String primaryTypeName,
@NotNull java.lang.Iterable<java.lang.String> mixinTypes,
@NotNull java.lang.String nodeTypeName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(@NotNull java.lang.String typeName,
@NotNull java.lang.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 java.lang.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(java.lang.String name)
This implementation always throws a
UnsupportedRepositoryOperationException . |
void |
unregisterNodeTypes(java.lang.String[] names)
This implementation always throws a
UnsupportedRepositoryOperationException . |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isNodeType
@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(java.lang.String name) throws RepositoryException
hasNodeType
in interface NodeTypeManager
RepositoryException
public NodeType getNodeType(java.lang.String name) throws RepositoryException
getNodeType
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator getAllNodeTypes() throws RepositoryException
getAllNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
getPrimaryNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException
createNodeTypeTemplate
in interface NodeTypeManager
RepositoryException
public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws RepositoryException
createNodeTypeTemplate
in interface NodeTypeManager
RepositoryException
public NodeDefinitionTemplate createNodeDefinitionTemplate() throws RepositoryException
createNodeDefinitionTemplate
in interface NodeTypeManager
RepositoryException
public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws RepositoryException
createPropertyDefinitionTemplate
in interface NodeTypeManager
RepositoryException
public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException
.registerNodeType
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException
.registerNodeTypes
in interface NodeTypeManager
RepositoryException
public void unregisterNodeType(java.lang.String name) throws RepositoryException
UnsupportedRepositoryOperationException
.unregisterNodeType
in interface NodeTypeManager
RepositoryException
public void unregisterNodeTypes(java.lang.String[] names) throws RepositoryException
UnsupportedRepositoryOperationException
.unregisterNodeTypes
in interface NodeTypeManager
RepositoryException
public boolean isNodeType(@NotNull @NotNull Tree tree, @NotNull @NotNull java.lang.String oakNtName)
EffectiveNodeTypeProvider
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
. 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 EffectiveNodeTypeProvider
tree
- The tree to be tested.oakNtName
- The internal oak name of the node type to be tested.public boolean isNodeType(@Nullable @Nullable java.lang.String primaryTypeName, @NotNull @NotNull java.lang.Iterable<java.lang.String> mixinTypes, @NotNull @NotNull java.lang.String nodeTypeName)
EffectiveNodeTypeProvider
true
if typeName
is of the specified primary node
type or mixin type, or a subtype thereof. Returns false
otherwise.isNodeType
in interface EffectiveNodeTypeProvider
primaryTypeName
- 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 java.lang.String typeName, @NotNull @NotNull java.lang.String superName)
EffectiveNodeTypeProvider
true
if typeName
is of the specified primary node
type or mixin type, or a subtype thereof. Returns false
otherwise.isNodeType
in interface EffectiveNodeTypeProvider
typeName
- 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 EffectiveNodeTypeProvider
node
- node instanceRepositoryException
- if the type information can not be accessed@NotNull public @NotNull EffectiveNodeType getEffectiveNodeType(@NotNull @NotNull Tree tree) throws RepositoryException
EffectiveNodeTypeProvider
getEffectiveNodeType
in interface EffectiveNodeTypeProvider
tree
- the treeRepositoryException
- if the type information can not be accessed,@NotNull public @NotNull NodeDefinition getRootDefinition() throws RepositoryException
getRootDefinition
in interface DefinitionProvider
RepositoryException
@NotNull public @NotNull NodeDefinition getDefinition(@NotNull @NotNull Tree parent, @NotNull @NotNull java.lang.String nodeName) throws RepositoryException
DefinitionProvider
parent
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 DefinitionProvider
parent
- 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
DefinitionProvider
getDefinition
in interface DefinitionProvider
parent
- 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
DefinitionProvider
getDefinition
in interface DefinitionProvider
parent
- 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