org.apache.jackrabbit.core.nodetype
Class NodeTypeManagerImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl
All Implemented Interfaces:
Dumpable, JackrabbitNodeTypeManager, NodeTypeManager, NodeTypeRegistryListener

public class NodeTypeManagerImpl
extends Object
implements JackrabbitNodeTypeManager, Dumpable, NodeTypeRegistryListener

A NodeTypeManagerImpl implements a session dependant NodeTypeManager.


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.api.JackrabbitNodeTypeManager
TEXT_X_JCR_CND, TEXT_XML
 
Constructor Summary
NodeTypeManagerImpl(NodeTypeRegistry ntReg, NamespaceResolver nsResolver)
          Creates a new NodeTypeManagerImpl instance.
 
Method Summary
 void dump(PrintStream ps)
          Dumps the state of this instance in a human readable format for diagnostic purposes.
 NodeTypeIterator getAllNodeTypes()
          
 NodeTypeIterator getMixinNodeTypes()
          
 NodeDefinitionImpl getNodeDefinition(NodeDefId id)
           
 NodeTypeImpl getNodeType(QName name)
           
 NodeType getNodeType(String nodeTypeName)
          
 NodeTypeRegistry getNodeTypeRegistry()
           
 NodeTypeIterator getPrimaryNodeTypes()
          
 PropertyDefinitionImpl getPropertyDefinition(PropDefId id)
           
 NodeDefinitionImpl getRootNodeDefinition()
           
 void nodeTypeRegistered(QName ntName)
          Called when a node type has been registered.
 void nodeTypeReRegistered(QName ntName)
          Called when a node type has been re-registered.
 void nodeTypeUnregistered(QName ntName)
          Called when a node type has been deregistered.
 NodeType[] registerNodeTypes(InputSource in)
          Registers the node types defined in the given XML stream.
 NodeType[] registerNodeTypes(InputStream in, String contentType)
          Registers node types from the given input stream of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTypeManagerImpl

public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
                           NamespaceResolver nsResolver)
Creates a new NodeTypeManagerImpl instance.

Parameters:
ntReg - node type registry
nsResolver - namespace resolver
Method Detail

getRootNodeDefinition

public NodeDefinitionImpl getRootNodeDefinition()
Returns:

getNodeDefinition

public NodeDefinitionImpl getNodeDefinition(NodeDefId id)
Parameters:
id -
Returns:

getPropertyDefinition

public PropertyDefinitionImpl getPropertyDefinition(PropDefId id)
Parameters:
id -
Returns:

getNodeType

public NodeTypeImpl getNodeType(QName name)
                         throws NoSuchNodeTypeException
Parameters:
name -
Returns:
Throws:
NoSuchNodeTypeException

getNodeTypeRegistry

public NodeTypeRegistry getNodeTypeRegistry()
Returns:

nodeTypeRegistered

public void nodeTypeRegistered(QName ntName)
Called when a node type has been registered.

Specified by:
nodeTypeRegistered in interface NodeTypeRegistryListener
Parameters:
ntName - name of the node type that has been registered

nodeTypeReRegistered

public void nodeTypeReRegistered(QName ntName)
Called when a node type has been re-registered.

Specified by:
nodeTypeReRegistered in interface NodeTypeRegistryListener
Parameters:
ntName - name of the node type that has been registered

nodeTypeUnregistered

public void nodeTypeUnregistered(QName ntName)
Called when a node type has been deregistered.

Specified by:
nodeTypeUnregistered in interface NodeTypeRegistryListener
Parameters:
ntName - name of the node type that has been unregistered

getAllNodeTypes

public NodeTypeIterator getAllNodeTypes()
                                 throws RepositoryException

Specified by:
getAllNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getPrimaryNodeTypes

public NodeTypeIterator getPrimaryNodeTypes()
                                     throws RepositoryException

Specified by:
getPrimaryNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getMixinNodeTypes

public NodeTypeIterator getMixinNodeTypes()
                                   throws RepositoryException

Specified by:
getMixinNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getNodeType

public NodeType getNodeType(String nodeTypeName)
                     throws NoSuchNodeTypeException

Specified by:
getNodeType in interface NodeTypeManager
Throws:
NoSuchNodeTypeException

registerNodeTypes

public NodeType[] registerNodeTypes(InputSource in)
                             throws SAXException,
                                    RepositoryException
Registers the node types defined in the given XML stream. This is a trivial implementation that just invokes the existing NodeTypeReader and NodeTypeRegistry methods and heuristically creates the returned node type array. Registers node types from the given node type XML stream.

Specified by:
registerNodeTypes in interface JackrabbitNodeTypeManager
Parameters:
in - node type XML stream
Returns:
registered node types
Throws:
RepositoryException - if the node types are invalid or another repository error occurs
SAXException - if the XML stream could not be read or parsed

registerNodeTypes

public NodeType[] registerNodeTypes(InputStream in,
                                    String contentType)
                             throws IOException,
                                    RepositoryException
Registers node types from the given input stream of the given type.

Specified by:
registerNodeTypes in interface JackrabbitNodeTypeManager
Parameters:
in - node type stream
contentType - type of the input stream
Returns:
registered node types
Throws:
IOException - if the input stream could not be read or parsed
RepositoryException - if the node types are invalid or another repository error occurs

dump

public void dump(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes.

Specified by:
dump in interface Dumpable
Parameters:
ps - stream to dump state to


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.