Class TemplateBuilderFactory
- java.lang.Object
-
- org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
-
- org.apache.jackrabbit.commons.cnd.TemplateBuilderFactory
-
public class TemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
This implementation ofDefinitionBuilderFactory
can be used with theCompactNodeTypeDefReader
to produce node type definitions of typeNodeTypeTemplate
and a namespace map of typeNamespaceRegistry
. It usesTemplateBuilderFactory.NodeTypeTemplateBuilder
for building node type definitions,TemplateBuilderFactory.PropertyDefinitionTemplateBuilder
for building property definitions, andTemplateBuilderFactory.NodeDefinitionTemplateBuilder
for building node definitions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TemplateBuilderFactory.NodeDefinitionTemplateBuilder
class
TemplateBuilderFactory.NodeTypeTemplateBuilder
class
TemplateBuilderFactory.PropertyDefinitionTemplateBuilder
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory
DefinitionBuilderFactory.AbstractItemDefinitionBuilder<T>, DefinitionBuilderFactory.AbstractNodeDefinitionBuilder<T>, DefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder<T>, DefinitionBuilderFactory.AbstractPropertyDefinitionBuilder<T>
-
-
Constructor Summary
Constructors Constructor Description TemplateBuilderFactory(NodeTypeManager nodeTypeManager, ValueFactory valueFactory, NamespaceRegistry namespaceRegistry)
TemplateBuilderFactory(Session session)
Creates a newTemplateBuilderFactory
for the specifiedSession
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamespaceRegistry
getNamespaceMapping()
DefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder<NodeTypeTemplate>
newNodeTypeDefinitionBuilder()
Create a new instance of aDefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder
void
setNamespace(java.lang.String prefix, java.lang.String uri)
Add a mapping to the namespace mapvoid
setNamespaceMapping(NamespaceRegistry namespaceRegistry)
Set the namespace mapping to use for the node type definition being built
-
-
-
Constructor Detail
-
TemplateBuilderFactory
public TemplateBuilderFactory(NodeTypeManager nodeTypeManager, ValueFactory valueFactory, NamespaceRegistry namespaceRegistry)
-
TemplateBuilderFactory
public TemplateBuilderFactory(Session session) throws RepositoryException
Creates a newTemplateBuilderFactory
for the specifiedSession
. This is equivalent toTemplateBuilderFactory(NodeTypeManager, ValueFactory, NamespaceRegistry)
where all parameters are obtained from the given session object and the workspace associated with it.- Parameters:
session
- The repository session.- Throws:
RepositoryException
- If an error occurs.
-
-
Method Detail
-
newNodeTypeDefinitionBuilder
public DefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder<NodeTypeTemplate> newNodeTypeDefinitionBuilder() throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from class:DefinitionBuilderFactory
Create a new instance of aDefinitionBuilderFactory.AbstractNodeTypeDefinitionBuilder
- Specified by:
newNodeTypeDefinitionBuilder
in classDefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
- Returns:
- Throws:
RepositoryException
UnsupportedRepositoryOperationException
-
setNamespaceMapping
public void setNamespaceMapping(NamespaceRegistry namespaceRegistry)
Description copied from class:DefinitionBuilderFactory
Set the namespace mapping to use for the node type definition being built- Specified by:
setNamespaceMapping
in classDefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
-
getNamespaceMapping
public NamespaceRegistry getNamespaceMapping()
- Specified by:
getNamespaceMapping
in classDefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
- Returns:
- the namespace mapping used for the node type definition being built
-
setNamespace
public void setNamespace(java.lang.String prefix, java.lang.String uri)
Description copied from class:DefinitionBuilderFactory
Add a mapping to the namespace map- Specified by:
setNamespace
in classDefinitionBuilderFactory<NodeTypeTemplate,NamespaceRegistry>
-
-