public abstract class ReadOnlyNodeTypeManager extends java.lang.Object implements 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() |
PropertyDefinition |
getDefinition(Tree parent,
PropertyState property,
boolean exactTypeMatch)
Calculates the applicable definition for the property state under the
given parent tree.
|
NodeDefinition |
getDefinition(Tree parent,
java.lang.String nodeName)
Returns the node definition for a child node of
parent named
nodeName with a default primary type. |
NodeDefinition |
getDefinition(Tree parent,
Tree targetNode)
Calculates the applicable definition for the child node under the given
parent node.
|
EffectiveNodeType |
getEffectiveNodeType(Node node)
Returns all the node types of the given node, in a breadth-first
traversal order of the type hierarchy.
|
static 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() |
NodeDefinition |
getRootDefinition() |
boolean |
hasNodeType(java.lang.String name) |
boolean |
isNodeType(java.lang.String primaryTypeName,
java.util.Iterator<java.lang.String> mixinTypes,
java.lang.String nodeTypeName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(java.lang.String typeName,
java.lang.String superName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(Tree tree,
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. |
public static 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
RepositoryExceptionpublic NodeType getNodeType(java.lang.String name)
throws RepositoryException
RepositoryExceptionpublic NodeTypeIterator getAllNodeTypes()
throws RepositoryException
RepositoryExceptionpublic NodeTypeIterator getPrimaryNodeTypes()
throws RepositoryException
RepositoryExceptionpublic NodeTypeIterator getMixinNodeTypes()
throws RepositoryException
RepositoryExceptionpublic NodeTypeTemplate createNodeTypeTemplate()
throws RepositoryException
RepositoryExceptionpublic NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd)
throws RepositoryException
RepositoryExceptionpublic NodeDefinitionTemplate createNodeDefinitionTemplate()
throws RepositoryException
RepositoryExceptionpublic PropertyDefinitionTemplate createPropertyDefinitionTemplate()
throws RepositoryException
RepositoryExceptionpublic NodeType registerNodeType(NodeTypeDefinition ntd,
boolean allowUpdate)
throws RepositoryException
UnsupportedRepositoryOperationException.RepositoryExceptionpublic NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds,
boolean allowUpdate)
throws RepositoryException
UnsupportedRepositoryOperationException.RepositoryExceptionpublic void unregisterNodeType(java.lang.String name)
throws RepositoryException
UnsupportedRepositoryOperationException.RepositoryExceptionpublic void unregisterNodeTypes(java.lang.String[] names)
throws RepositoryException
UnsupportedRepositoryOperationException.RepositoryExceptionpublic boolean isNodeType(Tree tree, java.lang.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.isNodeType in interface EffectiveNodeTypeProvidertree - The tree to be tested.oakNtName - The internal oak name of the node type to be tested.public boolean isNodeType(java.lang.String primaryTypeName,
java.util.Iterator<java.lang.String> mixinTypes,
java.lang.String nodeTypeName)
throws NoSuchNodeTypeException,
RepositoryException
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.NoSuchNodeTypeException - If the specified node type name doesn't
refer to an existing node type.RepositoryException - If the given node type name is invalid or if
some other error occurs.public boolean isNodeType(java.lang.String typeName,
java.lang.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.public EffectiveNodeType getEffectiveNodeType(Node node) throws RepositoryException
getEffectiveNodeType in interface EffectiveNodeTypeProvidernode - node instanceRepositoryException - if the type information can not be accessedpublic NodeDefinition getRootDefinition()
throws RepositoryException
getRootDefinition in interface DefinitionProviderRepositoryExceptionpublic NodeDefinition getDefinition(Tree parent, java.lang.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.RepositoryException - If another error occurs.public NodeDefinition getDefinition(Tree parent, Tree targetNode) throws RepositoryException
DefinitionProvidergetDefinition in interface DefinitionProviderparent - The parent node.targetNode - The child node for which the definition is calculated.RepositoryException - If another error occurs.public PropertyDefinition getDefinition(Tree parent, PropertyState property, boolean exactTypeMatch) throws RepositoryException
DefinitionProvidergetDefinition in interface DefinitionProviderparent - The parent tree.property - The target property.RepositoryException - If another error occurs."Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"