Class AbstractNodeTypeManager
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
-
- All Implemented Interfaces:
NodeTypeManager
public abstract class AbstractNodeTypeManager extends Object implements NodeTypeManager
AbstractNodeTypeManagercovers creation of node type templates and definition templates.
-
-
Constructor Summary
Constructors Constructor Description AbstractNodeTypeManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NodeDefinitionTemplatecreateNodeDefinitionTemplate()Returns an emptyNodeDefinitionTemplatewhich can then be used to create a child node definition and attached to aNodeTypeTemplate.NodeTypeTemplatecreateNodeTypeTemplate()Returns an emptyNodeTypeTemplatewhich can then be used to define a node type and passed toNodeTypeManager.registerNodeType.NodeTypeTemplatecreateNodeTypeTemplate(NodeTypeDefinition ntd)Returns aNodeTypeTemplateholding the specified node type definition.PropertyDefinitionTemplatecreatePropertyDefinitionTemplate()Returns an emptyPropertyDefinitionTemplatewhich can then be used to create a property definition and attached to aNodeTypeTemplate.abstract NamePathResolvergetNamePathResolver()Returns the NamePathResolver used to validate JCR names.abstract NodeDefinitiongetNodeDefinition(QNodeDefinition nd)Retrieve theNodeDefinitionfor the givenQNodeDefinition.abstract NodeTypegetNodeType(Name ntName)Return the node type with the specifiedntName.abstract PropertyDefinitiongetPropertyDefinition(QPropertyDefinition pd)Retrieve thePropertyDefinitionfor the givenQPropertyDefinition.NodeTyperegisterNodeType(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, wait
-
Methods inherited from interface javax.jcr.nodetype.NodeTypeManager
getAllNodeTypes, getMixinNodeTypes, getNodeType, getPrimaryNodeTypes, hasNodeType, registerNodeTypes, unregisterNodeTypes
-
-
-
-
Method Detail
-
getNodeType
public abstract NodeType getNodeType(Name ntName) throws NoSuchNodeTypeException
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
public abstract NodeDefinition getNodeDefinition(QNodeDefinition nd)
Retrieve theNodeDefinitionfor the givenQNodeDefinition.- Parameters:
nd- the QNodeDefinition.- Returns:
- the node definition.
-
getPropertyDefinition
public abstract PropertyDefinition getPropertyDefinition(QPropertyDefinition pd)
Retrieve thePropertyDefinitionfor the givenQPropertyDefinition.- Parameters:
pd- the QPropertyDefinition.- Returns:
- the property definition.
-
getNamePathResolver
public abstract NamePathResolver 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, RepositoryException
Description 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:
NodeTypeManager.createNodeTypeTemplate()
-
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:
NodeTypeManager.createNodeTypeTemplate(NodeTypeDefinition)
-
createNodeDefinitionTemplate
public NodeDefinitionTemplate createNodeDefinitionTemplate() throws UnsupportedRepositoryOperationException, RepositoryException
Description 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:
NodeTypeManager.createNodeDefinitionTemplate()
-
createPropertyDefinitionTemplate
public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws UnsupportedRepositoryOperationException, RepositoryException
Description 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:
NodeTypeManager.createPropertyDefinitionTemplate()
-
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:
InvalidNodeTypeDefinitionException- if theNodeTypeDefinitionis invalid.NodeTypeExistsException- ifallowUpdateisfalseand theNodeTypeDefinitionspecifies a node type name that is already registered.UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.- See Also:
NodeTypeManager.registerNodeType(NodeTypeDefinition, boolean)
-
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:
NodeTypeManager.unregisterNodeType(String)
-
-