D
- The type of domain objects to assemble the XML document frompublic abstract class XmlPdiAssembler<D> extends PdiAssembler<D>
Constructor and Description |
---|
XmlPdiAssembler(java.net.URI namespace,
java.lang.String domainObjectName)
Create an instance.
|
XmlPdiAssembler(java.net.URI namespace,
java.lang.String domainObjectName,
java.io.InputStream schema)
Create an instance.
|
XmlPdiAssembler(java.net.URI namespace,
java.lang.String documentElementName,
java.lang.String domainObjectName)
Create an instance.
|
XmlPdiAssembler(java.net.URI namespace,
java.lang.String documentElementName,
java.lang.String domainObjectName,
java.io.InputStream schema)
Create an instance.
|
XmlPdiAssembler(java.net.URI namespace,
java.lang.String documentElementName,
java.lang.String domainObjectName,
Validator validator)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(D domainObject,
java.util.Map<java.lang.String,ContentInfo> contentInfo,
java.io.PrintWriter writer)
Add a domain object.
|
protected abstract void |
doAdd(D domainObject,
java.util.Map<java.lang.String,ContentInfo> contentInfo)
Add the domain object to the XML document, using getBuilder().
|
void |
end(java.io.PrintWriter writer)
End the assembly process.
|
protected XmlBuilder<java.lang.Void> |
getBuilder()
Return the XML document builder for capturing a domain object.
|
void |
start(java.io.PrintWriter writer)
Start the assembly process.
|
add
add, end, getMetrics, start
public XmlPdiAssembler(java.net.URI namespace, java.lang.String domainObjectName)
namespace
- Optional URI of the XML Namespace to use for the XML documentdomainObjectName
- The name/tag of the element that captures the domain object. The pluralized version of this
will be used for the document element name/tag.public XmlPdiAssembler(java.net.URI namespace, java.lang.String documentElementName, java.lang.String domainObjectName)
namespace
- Optional URI of the XML Namespace to use for the XML documentdocumentElementName
- The name/tag of the document element wrapping the domain objects. This may be
null
if only one domain object is ever addeddomainObjectName
- The name/tag of the element that captures the domain objectpublic XmlPdiAssembler(java.net.URI namespace, java.lang.String domainObjectName, java.io.InputStream schema)
namespace
- Optional URI of the XML Namespace to use for the XML documentdomainObjectName
- The name/tag of the element that captures the domain objectschema
- Optional XML Schema for validating the assembled XML documentpublic XmlPdiAssembler(java.net.URI namespace, java.lang.String documentElementName, java.lang.String domainObjectName, java.io.InputStream schema)
namespace
- Optional URI of the XML Namespace to use for the XML documentdocumentElementName
- The name/tag of the document element wrapping the domain objects. This may be
null
if only one domain object is ever addeddomainObjectName
- The name/tag of the element that captures the domain objectschema
- Optional XML Schema for validating the assembled XML documentpublic XmlPdiAssembler(java.net.URI namespace, java.lang.String documentElementName, java.lang.String domainObjectName, Validator validator)
namespace
- Optional URI of the XML Namespace to use for the XML documentdocumentElementName
- The name/tag of the document element wrapping the domain objects. This may be
null
if only one domain object is ever addeddomainObjectName
- The name/tag of the element that captures the domain objectvalidator
- Optional validator for checking whether the XML document meets expectationsprotected XmlBuilder<java.lang.Void> getBuilder()
protected abstract void doAdd(D domainObject, java.util.Map<java.lang.String,ContentInfo> contentInfo)
domainObject
- The domain object to addcontentInfo
- The reference information and the encoded hashed of the content associated with the domain
objectpublic void start(java.io.PrintWriter writer)
PrintWriterAssembler
start
in class PrintWriterAssembler<HashedContents<D>>
writer
- Where to write outputpublic final void add(D domainObject, java.util.Map<java.lang.String,ContentInfo> contentInfo, java.io.PrintWriter writer)
PdiAssembler
add
in class PdiAssembler<D>
domainObject
- The domain object to addcontentInfo
- The reference information and the encoded hashes of the content associated with the domain
objectwriter
- The writer to print the PDI fragment topublic final void end(java.io.PrintWriter writer)
PrintWriterAssembler
end
in class PrintWriterAssembler<HashedContents<D>>
writer
- Where to write output