public class NodeTypeManagerImpl extends AbstractNodeTypeManager implements JackrabbitNodeTypeManager, NodeTypeRegistryListener
NodeTypeManagerImpl
implements a session dependant
NodeTypeManager.TEXT_X_JCR_CND, TEXT_XML
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, unregisterNodeType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createNodeDefinitionTemplate, createNodeTypeTemplate, createNodeTypeTemplate, createPropertyDefinitionTemplate, registerNodeType, unregisterNodeType
public NodeTypeManagerImpl(SessionContext context)
NodeTypeManagerImpl
instance.context
- the session contextpublic void dispose()
public NodeDefinitionImpl getRootNodeDefinition()
public NodeDefinitionImpl getNodeDefinition(QNodeDefinition def)
AbstractNodeTypeManager
NodeDefinition
for the given
QNodeDefinition
.getNodeDefinition
in class AbstractNodeTypeManager
def
- the QNodeDefinitionpublic PropertyDefinitionImpl getPropertyDefinition(QPropertyDefinition def)
AbstractNodeTypeManager
PropertyDefinition
for the given
QPropertyDefinition
.getPropertyDefinition
in class AbstractNodeTypeManager
def
- prop defpublic NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException
AbstractNodeTypeManager
ntName
.getNodeType
in class AbstractNodeTypeManager
name
- node type nameNoSuchNodeTypeException
- if the nodetype does not exitpublic NamePathResolver getNamePathResolver()
AbstractNodeTypeManager
getNamePathResolver
in class AbstractNodeTypeManager
AbstractNodeTypeManager.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 NodeTypeRegistryListener
ntName
- name of the node type that has been registeredpublic void nodeTypeReRegistered(Name ntName)
nodeTypeReRegistered
in interface NodeTypeRegistryListener
ntName
- name of the node type that has been registeredpublic void nodeTypesUnregistered(Collection<Name> names)
nodeTypesUnregistered
in interface NodeTypeRegistryListener
names
- names of the types that have been unregisteredpublic 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 NodeType getNodeType(String nodeTypeName) throws NoSuchNodeTypeException
getNodeType
in interface NodeTypeManager
NoSuchNodeTypeException
public 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 JackrabbitNodeTypeManager
SAXException
RepositoryException
public NodeType[] registerNodeTypes(InputStream in, String contentType) throws IOException, RepositoryException
registerNodeTypes
in interface JackrabbitNodeTypeManager
IOException
RepositoryException
public boolean hasNodeType(String name) throws RepositoryException
hasNodeType
in interface NodeTypeManager
hasNodeType
in interface JackrabbitNodeTypeManager
name
- 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 NodeTypeManager
definitions
- a collection of NodeTypeDefinition
sallowUpdate
- 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 NodeTypeManager
names
- 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–2023 The Apache Software Foundation. All rights reserved.