public class NodeTypeManagerImpl extends AbstractNodeTypeManager implements org.apache.jackrabbit.api.JackrabbitNodeTypeManager, NodeTypeRegistryListener
NodeTypeManagerImpl implements a session dependant
NodeTypeManager.| Constructor and Description |
|---|
NodeTypeManagerImpl(SessionContext context)
Creates a new
NodeTypeManagerImpl instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes this node type manager.
|
NodeTypeIterator |
getAllNodeTypes() |
NodeTypeIterator |
getMixinNodeTypes() |
NamePathResolver |
getNamePathResolver()
Returns the NamePathResolver used to validate JCR names.
|
NodeDefinitionImpl |
getNodeDefinition(QNodeDefinition def)
Retrieve the
NodeDefinition for the given
QNodeDefinition. |
NodeTypeImpl |
getNodeType(Name name)
Return the node type with the specified
ntName. |
NodeType |
getNodeType(String nodeTypeName) |
NodeTypeRegistry |
getNodeTypeRegistry() |
NodeTypeIterator |
getPrimaryNodeTypes() |
PropertyDefinitionImpl |
getPropertyDefinition(QPropertyDefinition def)
Retrieve the
PropertyDefinition for the given
QPropertyDefinition. |
NodeDefinitionImpl |
getRootNodeDefinition() |
boolean |
hasNodeType(String name)
Checks whether a node type with the given name exists.
|
void |
nodeTypeRegistered(Name ntName)
Called when a node type has been registered.
|
void |
nodeTypeReRegistered(Name ntName)
Called when a node type has been re-registered.
|
void |
nodeTypesUnregistered(Collection<Name> names)
Called when a set of node types has been unregistered.
|
NodeType[] |
registerNodeTypes(InputSource in)
Registers the node types defined in the given XML stream.
|
NodeType[] |
registerNodeTypes(InputStream in,
String contentType)
Registers the node types defined in the given input stream depending
on the content type specified for the stream.
|
NodeType[] |
registerNodeTypes(InputStream in,
String contentType,
boolean reregisterExisting)
Registers the node types defined in the given input stream depending
on the content type specified for the stream.
|
NodeTypeIterator |
registerNodeTypes(NodeTypeDefinition[] definitions,
boolean allowUpdate)
Registers or updates the specified
Collection of
NodeTypeDefinition objects. |
String |
toString() |
void |
unregisterNodeTypes(String[] names)
Unregisters the specified set of node types.
|
createNodeDefinitionTemplate, createNodeTypeTemplate, createNodeTypeTemplate, createPropertyDefinitionTemplate, registerNodeType, unregisterNodeTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateNodeDefinitionTemplate, createNodeTypeTemplate, createNodeTypeTemplate, createPropertyDefinitionTemplate, registerNodeType, unregisterNodeTypepublic NodeTypeManagerImpl(SessionContext context)
NodeTypeManagerImpl instance.context - the session contextpublic void dispose()
public NodeDefinitionImpl getRootNodeDefinition()
public NodeDefinitionImpl getNodeDefinition(QNodeDefinition def)
AbstractNodeTypeManagerNodeDefinition for the given
QNodeDefinition.getNodeDefinition in class AbstractNodeTypeManagerdef - the QNodeDefinitionpublic PropertyDefinitionImpl getPropertyDefinition(QPropertyDefinition def)
AbstractNodeTypeManagerPropertyDefinition for the given
QPropertyDefinition.getPropertyDefinition in class AbstractNodeTypeManagerdef - prop defpublic NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException
AbstractNodeTypeManagerntName.getNodeType in class AbstractNodeTypeManagername - node type nameNoSuchNodeTypeException - if the nodetype does not exitpublic NamePathResolver getNamePathResolver()
AbstractNodeTypeManagergetNamePathResolver in class AbstractNodeTypeManagerAbstractNodeTypeManager.getNamePathResolver()public NodeTypeRegistry getNodeTypeRegistry()
public NodeType[] registerNodeTypes(InputStream in, String contentType, boolean reregisterExisting) throws IOException, RepositoryException
in - node type XML streamcontentType - type of the input streamreregisterExisting - flag indicating whether node types should be
reregistered if they already existIOException - if the input stream could not be read or parsedRepositoryException - if the node types are invalid or another
repository error occurspublic void nodeTypeRegistered(Name ntName)
nodeTypeRegistered in interface NodeTypeRegistryListenerntName - name of the node type that has been registeredpublic void nodeTypeReRegistered(Name ntName)
nodeTypeReRegistered in interface NodeTypeRegistryListenerntName - name of the node type that has been registeredpublic void nodeTypesUnregistered(Collection<Name> names)
nodeTypesUnregistered in interface NodeTypeRegistryListenernames - names of the types that have been unregisteredpublic NodeTypeIterator getAllNodeTypes() throws RepositoryException
getAllNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
getPrimaryNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeTypeIterator getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes in interface NodeTypeManagerRepositoryExceptionpublic NodeType getNodeType(String nodeTypeName) throws NoSuchNodeTypeException
getNodeType in interface NodeTypeManagerNoSuchNodeTypeExceptionpublic NodeType[] registerNodeTypes(InputSource in) throws SAXException, RepositoryException
NodeTypeReader and NodeTypeRegistry methods and
heuristically creates the returned node type array. It will also
register any namespaces defined in the input source that have not
already been registered.
registerNodeTypes in interface org.apache.jackrabbit.api.JackrabbitNodeTypeManagerSAXExceptionRepositoryExceptionpublic NodeType[] registerNodeTypes(InputStream in, String contentType) throws IOException, RepositoryException
registerNodeTypes in interface org.apache.jackrabbit.api.JackrabbitNodeTypeManagerIOExceptionRepositoryExceptionpublic boolean hasNodeType(String name) throws RepositoryException
hasNodeType in interface NodeTypeManagerhasNodeType in interface org.apache.jackrabbit.api.JackrabbitNodeTypeManagername - node type nametrue if the named node type exists,
false otherwiseRepositoryException - if the name format is invalidpublic NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] definitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException
Collection of
NodeTypeDefinition objects. This method is used to register
or update a set of node types with mutual dependencies. Returns an
iterator over the resulting NodeType objects.
The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.
Throws an InvalidNodeTypeDefinitionException if a
NodeTypeDefinition within the Collection is
invalid or if the Collection contains an object of a type
other than NodeTypeDefinition.
Throws a NodeTypeExistsException if allowUpdate
is false and a NodeTypeDefinition within the
Collection specifies a node type name that is already
registered.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
registerNodeTypes in interface NodeTypeManagerdefinitions - a collection of NodeTypeDefinitionsallowUpdate - a booleanInvalidNodeTypeDefinitionException - if a
NodeTypeDefinition within the Collection is
invalid or if the Collection contains an object of a type
other than NodeTypeDefinition.NodeTypeExistsException - if allowUpdate is
false and a NodeTypeDefinition within the
Collection specifies a node type name that is already
registered.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.RepositoryException - if another error occurs.public void unregisterNodeTypes(String[] names) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException
Throws a NoSuchNodeTypeException if one of the names listed is not a registered node type.
Throws an UnsupportedRepositoryOperationException
if this implementation does not support node type registration.
unregisterNodeTypes in interface NodeTypeManagernames - a String arrayUnsupportedRepositoryOperationException - if this implementation does not support node type registration.NoSuchNodeTypeException - if one of the names listed is not a registered node type.RepositoryException - if another error occurs.Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.