Discovery of which node types are available in a content repository is done through the NodeTypeManager object, which is acquired via the Workspace. Recall from earlier in the specification:
javax.jcr. |
|
NodeTypeManager |
getNodeTypeManager() Returns the NodeTypeManager object through which available node types are discovered. There is one node type registry per repository, therefore the NodeTypeManager is not workspace-specific; it provides introspection methods for the global, repository-wide set of available node types. A RepositoryException is thrown if an error occurs. |
The NodeTypeManager provides the following methods:
javax.jcr.nodetype. |
|
NodeType |
getNodeType(String nodeTypeName) Returns the NodeType specified by nodeTypeName. If no node type by that name is registered, a NoSuchNodeTypeException is thrown. A RepositoryException is thrown if another error occurs. |
NodeType |
getAllNodeTypes() Returns all available node types, primary and mixin. A RepositoryException is thrown if an error occurs. |
NodeType |
getPrimaryNodeTypes() Returns all available primary node types. A RepositoryException is thrown if an error occurs. |
NodeType |
getMixinNodeTypes() Returns all available mixin types. If none are available, an empty iterator is returned. A RepositoryException is thrown if an error occurs. |