Class CndImporter
- java.lang.Object
- 
- org.apache.jackrabbit.commons.cnd.CndImporter
 
- 
 public final class CndImporter extends Object Utility class for importing compact node type definitions.- See Also:
- CompactNodeTypeDefReader,- TemplateBuilderFactory
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeType[]registerNodeTypes(Reader cnd, String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting)Registers nodetypes incndformat.static NodeType[]registerNodeTypes(Reader cnd, Session session)Shortcut forstatic NodeType[]registerNodeTypes(Reader cnd, Session session, boolean reregisterExisting)Shortcut for
 
- 
- 
- 
Method Detail- 
registerNodeTypespublic static NodeType[] registerNodeTypes(Reader cnd, Session session) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, IOException Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), false);wherewspis the workspace of thesessionpassed.- Parameters:
- cnd-
- session- the session to use for registering the node types
- Returns:
- the registered node types
- Throws:
- InvalidNodeTypeDefinitionException
- NodeTypeExistsException
- UnsupportedRepositoryOperationException
- ParseException
- RepositoryException
- IOException
- See Also:
- registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
 
 - 
registerNodeTypespublic static NodeType[] registerNodeTypes(Reader cnd, Session session, boolean reregisterExisting) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, IOException Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), reregisterExisting);wherewspis the workspace of thesessionpassed.- Parameters:
- cnd-
- session- the session to use for registering the node types
- reregisterExisting-- trueif existing node types should be re-registered with those present in the cnd.- falseotherwise.
- Returns:
- the registered node types
- Throws:
- InvalidNodeTypeDefinitionException
- NodeTypeExistsException
- UnsupportedRepositoryOperationException
- ParseException
- RepositoryException
- IOException
- See Also:
- registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
 
 - 
registerNodeTypespublic static NodeType[] registerNodeTypes(Reader cnd, String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting) throws ParseException, InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException, IOException Registers nodetypes incndformat.- Parameters:
- cnd- a reader to the cnd. The reader is closed on return.
- systemId- a informative id of the given cnd input.
- nodeTypeManager- the- NodeTypeManagerused for creating and registering the- NodeTypeTemplates,- NodeDefinitionTemplates and- PropertyDefinitionTemplates defined in the cnd.
- namespaceRegistry- the- NamespaceRegistryused for registering namespaces defined in the cnd.
- valueFactory- the- ValueFactoryused to create- default value(s).
- reregisterExisting-- trueif existing node types should be re-registered with those present in the cnd.- falseotherwise.
- Returns:
- the registered node types
- Throws:
- ParseException- if the cnd cannot be parsed
- InvalidNodeTypeDefinitionException- if a- NodeTypeDefinitionis invalid.
- NodeTypeExistsException- if- reregisterExistingis- falseand a- NodeTypeDefinitionspecifies a node type name that is already registered.
- UnsupportedRepositoryOperationException- if the- NodeTypeManagerdoes not support node type registration.
- IOException- if closing the cnd reader fails
- RepositoryException- if another error occurs.
 
 
- 
 
-