Class CompactNodeTypeDefWriter
java.lang.Object
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefWriter
- Direct Known Subclasses:
CompactNodeTypeDefWriter
Prints node type defs in a compact notation
Print Format:
<ex = "http://apache.org/jackrabbit/example">
[ex:NodeType] > ex:ParentType1, ex:ParentType2
orderable mixin
- ex:property (STRING) = 'default1', 'default2'
primary mandatory autocreated protected multiple VERSION
< 'constraint1', 'constraint2'
+ ex:node (ex:reqType1, ex:reqType2) = ex:defaultType
mandatory autocreated protected multiple VERSION
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceMap namespace prefixes such as present in a qualified JCR name to the corresponding namespace URI. -
Constructor Summary
ConstructorsConstructorDescriptionCompactNodeTypeDefWriter(Writer out, Session session, boolean includeNS) Creates a new nodetype writer based on a sessionCompactNodeTypeDefWriter(Writer out, CompactNodeTypeDefWriter.NamespaceMapping nsMapping, boolean includeNS) Creates a new nodetype writer based on a session -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes all pending write operations and Closes this writer.static voidwrite(Collection<NodeTypeDefinition> defs, Session session, Writer out) Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.static voidwrite(Collection<NodeTypeDefinition> defs, CompactNodeTypeDefWriter.NamespaceMapping nsMapping, Writer out) Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.voidwrite(NodeTypeDefinition ntd) Write one NodeTypeDefinition to this writervoidwriteNamespaceDeclaration(String prefix) Write a namespace declaration to this writer.
-
Constructor Details
-
CompactNodeTypeDefWriter
Creates a new nodetype writer based on a session- Parameters:
out- the underlying writersession- repository sessionincludeNS- iftrueall used namespace decl. are also written to the writer
-
CompactNodeTypeDefWriter
public CompactNodeTypeDefWriter(Writer out, CompactNodeTypeDefWriter.NamespaceMapping nsMapping, boolean includeNS) Creates a new nodetype writer based on a session- Parameters:
out- the underlying writernsMapping- the mapping from prefix to namespace URI.includeNS- iftrueall used namespace decl. are also written to the writer
-
-
Method Details
-
write
public static void write(Collection<NodeTypeDefinition> defs, Session session, Writer out) throws IOException Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.- Parameters:
defs- collection of definitionssession- sessionout- output writer- Throws:
IOException- if an I/O error occurs
-
write
public static void write(Collection<NodeTypeDefinition> defs, CompactNodeTypeDefWriter.NamespaceMapping nsMapping, Writer out) throws IOException Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.- Parameters:
defs- collection of definitionsnsMapping- the mapping from prefix to namespace URI.out- output writer- Throws:
IOException- if an I/O error occurs
-
write
Write one NodeTypeDefinition to this writer- Parameters:
ntd- node type definition- Throws:
IOException- if an I/O error occurs
-
writeNamespaceDeclaration
Write a namespace declaration to this writer. Note, that this method has no effect if there is no extra namespace write present.- Parameters:
prefix- namespace prefix- Throws:
IOException- if an I/O error occurs
-
close
Flushes all pending write operations and Closes this writer. please note, that the underlying writer remains open.- Throws:
IOException- if an I/O error occurs
-