Class NodeTypeRegistryImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeRegistryImpl
-
- All Implemented Interfaces:
EffectiveNodeTypeProvider,NodeTypeRegistry
public class NodeTypeRegistryImpl extends Object implements NodeTypeRegistry, EffectiveNodeTypeProvider
ANodeTypeRegistry...
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(NodeTypeRegistryListener listener)Add aNodeTypeRegistryListenerstatic NodeTypeRegistryImplcreate(NodeTypeStorage storage, NamespaceRegistry nsRegistry)Create a newNodeTypeRegistryvoiddispose()Clears all caches.EffectiveNodeTypegetEffectiveNodeType(Name ntName)Build theEffectiveNodeTypefrom the givenNodeTypename.EffectiveNodeTypegetEffectiveNodeType(Name[] ntNames)Build theEffectiveNodeTypefrom the given array ofNodeTypenames.EffectiveNodeTypegetEffectiveNodeType(Name[] ntNames, Map<Name,QNodeTypeDefinition> ntdMap)EffectiveNodeTypegetEffectiveNodeType(QNodeTypeDefinition ntd, Map<Name,QNodeTypeDefinition> ntdMap)Builds an effective node type representation from the given node type definition.QNodeTypeDefinitiongetNodeTypeDefinition(Name nodeTypeName)Returns the node type definition of the node type with the given name.Name[]getRegisteredNodeTypes()Returns the names of all registered node types.booleanisRegistered(Name nodeTypeName)voidregisterNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate)Registers the specified node type definitions.voidremoveListener(NodeTypeRegistryListener listener)Remove aNodeTypeRegistryListenerStringtoString()Returns the the state of this instance in a human readable format.voidunregisterNodeTypes(Collection<Name> nodeTypeNames)Unregisters a collection of node types.
-
-
-
Method Detail
-
create
public static NodeTypeRegistryImpl create(NodeTypeStorage storage, NamespaceRegistry nsRegistry)
Create a newNodeTypeRegistry- Parameters:
storage-nsRegistry-- Returns:
NodeTypeRegistryobject
-
dispose
public void dispose()
Clears all caches.
-
addListener
public void addListener(NodeTypeRegistryListener listener)
Description copied from interface:NodeTypeRegistryAdd aNodeTypeRegistryListener- Specified by:
addListenerin interfaceNodeTypeRegistry- Parameters:
listener- the new listener to be informed on (un)registration of node types- See Also:
NodeTypeRegistry.addListener(NodeTypeRegistryListener)
-
removeListener
public void removeListener(NodeTypeRegistryListener listener)
Description copied from interface:NodeTypeRegistryRemove aNodeTypeRegistryListener- Specified by:
removeListenerin interfaceNodeTypeRegistry- Parameters:
listener- an existing listener- See Also:
NodeTypeRegistry.removeListener(NodeTypeRegistryListener)
-
getRegisteredNodeTypes
public Name[] getRegisteredNodeTypes() throws RepositoryException
Description copied from interface:NodeTypeRegistryReturns the names of all registered node types. That includes primary and mixin node types.- Specified by:
getRegisteredNodeTypesin interfaceNodeTypeRegistry- Returns:
- the names of all registered node types.
- Throws:
RepositoryException- See Also:
NodeTypeRegistry.getRegisteredNodeTypes()
-
isRegistered
public boolean isRegistered(Name nodeTypeName)
- Specified by:
isRegisteredin interfaceNodeTypeRegistry- Returns:
- See Also:
NodeTypeRegistry.isRegistered(Name)
-
registerNodeTypes
public void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate) throws NodeTypeExistsException, InvalidNodeTypeDefinitionException, RepositoryException
Description copied from interface:NodeTypeRegistryRegisters the specified node type definitions. IfallowUpdateistrueexisting node types will be updated, otherwise anNodeTypeExistsExceptionis thrown.- Specified by:
registerNodeTypesin interfaceNodeTypeRegistry- Throws:
NodeTypeExistsExceptionInvalidNodeTypeDefinitionExceptionRepositoryException- See Also:
NodeTypeRegistry.registerNodeTypes(Collection, boolean)
-
unregisterNodeTypes
public void unregisterNodeTypes(Collection<Name> nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
Description copied from interface:NodeTypeRegistryUnregisters a collection of node types.- Specified by:
unregisterNodeTypesin interfaceNodeTypeRegistry- Parameters:
nodeTypeNames- a collection ofNameobjects denoting the node types to be unregistered- Throws:
NoSuchNodeTypeException- if any of the specified names does not denote a registered node type.RepositoryException- if another error occurs- See Also:
NodeTypeRegistry.unregisterNodeTypes(Collection)
-
getNodeTypeDefinition
public QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName) throws NoSuchNodeTypeException
Description copied from interface:NodeTypeRegistryReturns the node type definition of the node type with the given name.- Specified by:
getNodeTypeDefinitionin interfaceNodeTypeRegistry- Parameters:
nodeTypeName- name of node type whose definition should be returned.- Returns:
- the node type definition of the node type with the given name.
- Throws:
NoSuchNodeTypeException- if a node type with the given name does not exist- See Also:
NodeTypeRegistry.getNodeTypeDefinition(Name)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name ntName) throws NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProviderBuild theEffectiveNodeTypefrom the givenNodeTypename.- Specified by:
getEffectiveNodeTypein interfaceEffectiveNodeTypeProvider- Returns:
- Throws:
NoSuchNodeTypeException- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames) throws ConstraintViolationException, NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProviderBuild theEffectiveNodeTypefrom the given array ofNodeTypenames.- Specified by:
getEffectiveNodeTypein interfaceEffectiveNodeTypeProvider- Returns:
- Throws:
ConstraintViolationExceptionNoSuchNodeTypeException- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[])
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
- Specified by:
getEffectiveNodeTypein interfaceEffectiveNodeTypeProvider- Returns:
- Throws:
ConstraintViolationExceptionNoSuchNodeTypeException- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[], Map)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(QNodeTypeDefinition ntd, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProviderBuilds an effective node type representation from the given node type definition. Whereas all referenced node types must exist (i.e. must be present in the specified map), the definition itself is not required to be registered.- Specified by:
getEffectiveNodeTypein interfaceEffectiveNodeTypeProvider- Returns:
- Throws:
ConstraintViolationExceptionNoSuchNodeTypeException- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(QNodeTypeDefinition, Map)
-
-