Class AbstractNodeTypeManager
java.lang.Object
org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
- All Implemented Interfaces:
NodeTypeManager
AbstractNodeTypeManager covers creation of node type templates
and definition templates.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an emptyNodeDefinitionTemplatewhich can then be used to create a child node definition and attached to aNodeTypeTemplate.Returns an emptyNodeTypeTemplatewhich can then be used to define a node type and passed toNodeTypeManager.registerNodeType.Returns aNodeTypeTemplateholding the specified node type definition.Returns an emptyPropertyDefinitionTemplatewhich can then be used to create a property definition and attached to aNodeTypeTemplate.abstract NamePathResolverReturns the NamePathResolver used to validate JCR names.abstract NodeDefinitionRetrieve theNodeDefinitionfor the givenQNodeDefinition.abstract NodeTypegetNodeType(Name ntName) Return the node type with the specifiedntName.abstract PropertyDefinitionRetrieve thePropertyDefinitionfor the givenQPropertyDefinition.registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) Registers a new node type or updates an existing node type using the specified definition and returns the resultingNodeTypeobject.voidunregisterNodeType(String name) Unregisters the specified node type.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.jcr.nodetype.NodeTypeManager
getAllNodeTypes, getMixinNodeTypes, getNodeType, getPrimaryNodeTypes, hasNodeType, registerNodeTypes, unregisterNodeTypes
-
Constructor Details
-
AbstractNodeTypeManager
public AbstractNodeTypeManager()
-
-
Method Details
-
getNodeType
Return the node type with the specifiedntName.- Parameters:
ntName- Name of the node type to be returned.- Returns:
- the node type with the specified
ntName. - Throws:
NoSuchNodeTypeException- If no such node type exists.
-
getNodeDefinition
Retrieve theNodeDefinitionfor the givenQNodeDefinition.- Parameters:
nd- the QNodeDefinition.- Returns:
- the node definition.
-
getPropertyDefinition
Retrieve thePropertyDefinitionfor the givenQPropertyDefinition.- Parameters:
pd- the QPropertyDefinition.- Returns:
- the property definition.
-
getNamePathResolver
Returns the NamePathResolver used to validate JCR names.- Returns:
- the NamePathResolver used to convert JCR names/paths to internal onces and vice versa. The resolver may also be used to validate names passed to the various templates.
-
createNodeTypeTemplate
public NodeTypeTemplate createNodeTypeTemplate() throws UnsupportedRepositoryOperationException, RepositoryExceptionDescription copied from interface:NodeTypeManagerReturns an emptyNodeTypeTemplatewhich can then be used to define a node type and passed toNodeTypeManager.registerNodeType.- Specified by:
createNodeTypeTemplatein interfaceNodeTypeManager- Returns:
- A
NodeTypeTemplate. - Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.- See Also:
-
createNodeTypeTemplate
public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:NodeTypeManagerReturns aNodeTypeTemplateholding the specified node type definition. This template can then be altered and passed toNodeTypeManager.registerNodeType.- Specified by:
createNodeTypeTemplatein interfaceNodeTypeManager- Parameters:
ntd- aNodeTypeDefinition.- Returns:
- A
NodeTypeTemplate. - Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.- See Also:
-
createNodeDefinitionTemplate
public NodeDefinitionTemplate createNodeDefinitionTemplate() throws UnsupportedRepositoryOperationException, RepositoryExceptionDescription copied from interface:NodeTypeManagerReturns an emptyNodeDefinitionTemplatewhich can then be used to create a child node definition and attached to aNodeTypeTemplate.- Specified by:
createNodeDefinitionTemplatein interfaceNodeTypeManager- Returns:
- A
NodeDefinitionTemplate. - Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.- See Also:
-
createPropertyDefinitionTemplate
public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws UnsupportedRepositoryOperationException, RepositoryExceptionDescription copied from interface:NodeTypeManagerReturns an emptyPropertyDefinitionTemplatewhich can then be used to create a property definition and attached to aNodeTypeTemplate.- Specified by:
createPropertyDefinitionTemplatein interfaceNodeTypeManager- Returns:
- A
PropertyDefinitionTemplate. - Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.- See Also:
-
registerNodeType
public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException Description copied from interface:NodeTypeManagerRegisters a new node type or updates an existing node type using the specified definition and returns the resultingNodeTypeobject.Typically, the object passed to this method will be a
NodeTypeTemplate(a subclass ofNodeTypeDefinition) acquired fromNodeTypeManager.createNodeTypeTemplateand then filled-in with definition information.- Specified by:
registerNodeTypein interfaceNodeTypeManager- Parameters:
ntd- anNodeTypeDefinition.allowUpdate- a boolean- Returns:
- the registered node type
- Throws:
RepositoryException- if another error occurs.- See Also:
-
unregisterNodeType
public void unregisterNodeType(String name) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException Description copied from interface:NodeTypeManagerUnregisters the specified node type.- Specified by:
unregisterNodeTypein interfaceNodeTypeManager- Parameters:
name- aString.- Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.NoSuchNodeTypeException- if no registered node type exists with the specified name.RepositoryException- if another error occurs.- See Also:
-