public abstract class ReadOnlyNodeTypeManager extends 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,
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(String name) |
NodeTypeIterator |
getPrimaryNodeTypes() |
NodeDefinition |
getRootDefinition() |
boolean |
hasNodeType(String name) |
boolean |
isNodeType(String typeName,
String superName)
Returns
true if typeName is of the specified primary node
type or mixin type, or a subtype thereof. |
boolean |
isNodeType(Tree tree,
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 . |
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(String name) throws RepositoryException
RepositoryException
public NodeType getNodeType(String name) throws RepositoryException
RepositoryException
public NodeTypeIterator getAllNodeTypes() throws RepositoryException
RepositoryException
public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
RepositoryException
public NodeTypeIterator getMixinNodeTypes() throws RepositoryException
RepositoryException
public NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException
RepositoryException
public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws RepositoryException
RepositoryException
public NodeDefinitionTemplate createNodeDefinitionTemplate() throws RepositoryException
RepositoryException
public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws RepositoryException
RepositoryException
public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException
.RepositoryException
public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException
UnsupportedRepositoryOperationException
.RepositoryException
public void unregisterNodeType(String name) throws RepositoryException
UnsupportedRepositoryOperationException
.RepositoryException
public void unregisterNodeTypes(String[] names) throws RepositoryException
UnsupportedRepositoryOperationException
.RepositoryException
public boolean isNodeType(Tree tree, 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.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(String typeName, 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.public EffectiveNodeType getEffectiveNodeType(Node node) throws RepositoryException
getEffectiveNodeType
in interface EffectiveNodeTypeProvider
node
- node instanceRepositoryException
- if the type information can not be accessedpublic NodeDefinition getRootDefinition() throws RepositoryException
getRootDefinition
in interface DefinitionProvider
RepositoryException
public NodeDefinition getDefinition(Tree parent, 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.RepositoryException
- If another error occurs.public NodeDefinition getDefinition(Tree parent, Tree targetNode) throws RepositoryException
DefinitionProvider
getDefinition
in interface DefinitionProvider
parent
- 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
DefinitionProvider
getDefinition
in interface DefinitionProvider
parent
- The parent tree.property
- The target property.RepositoryException
- If another error occurs."Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"