Package org.opencastproject.oaipmh.util
Class XmlGen
java.lang.Object
org.opencastproject.oaipmh.util.XmlGen
- Direct Known Subclasses:
OaiXmlGen
DOM based XML generation environment. Implement
create() to create the XML. Serialize to an output stream
with generate(java.io.OutputStream).
todo document the node creator functions-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Nodeprotected Nodeprotected Nodeprotected Nodeprotected ElementCreate a new DOM element.protected Elementprotected Elementprotected ElementCreate an element with the qualified nameqname-- i.e.protected Elementprotected Element$e(String name, List<XmlGen.Namespace> namespaces, Node... nodes) protected Element$e(String name, List<XmlGen.Namespace> namespaces, NodeList nodes) protected Elementprotected Elementprotected Elementprotected ElementCreate an element with the qualified nameqname-- i.e.protected NodeConditional element.protected Elementprotected Nodeprotected Nodeprotected Node$eTxtBlank(String name, String text) protected Nodeprotected NodeText blank.abstract Elementcreate()Implement this method to create the DOM.generate()Generate the document.voidgenerate(OutputStream out) Generate the XML and write it toout.Generate the document as a string.protected NodenodeZero()The neutral element.protected XmlGen.Namespaceprotected NodeschemaLocation(String location)
-
Field Details
-
nodeZero
Lazy version ofnodeZero(). -
mkText
Create a text node from a string.
-
-
Constructor Details
-
XmlGen
Create a new environment.
-
-
Method Details
-
generate
Generate the XML and write it toout. -
generate
Generate the document. -
generateAsString
Generate the document as a string. -
create
Implement this method to create the DOM. Use the various node creation functions for this purpose. -
ns
-
schemaLocation
-
$langNode
-
$a
-
$aBlank
-
$aSome
-
$e
-
$e
Create an element with the qualified nameqname-- i.e.prefix:tagname-- in the namespacenamespacewith childrennodes. -
$e
-
$e
-
$e
-
$e
Create an element with the qualified nameqname-- i.e.prefix:tagname-- in the namespacenamespacewith childrennodes. -
$e
-
$eTxtBlank
-
$eTxt
-
$eTxt
-
$e
-
$e
-
$e
-
$e
-
$e
protected Element $e(String qname, String namespace, List<XmlGen.Namespace> namespaces, List<Node> nodes) Create a new DOM element.- Parameters:
qname- fully qualified tag name, e.g. "name" or "dc:title"namespace- namespace to which this tag belongs tonamespaces- additional namespace declarationsnodes- child nodes
-
$e
Conditional element. Only created if at least one subnode is present. Subnodes may be attributes, elements, text nodes, etc. -
$txt
-
$cdata
-
$txtBlank
Text blank. -
nodeZero
The neutral element.
-