public class XmlGenerator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
XmlGenerator.ObjectAndSignatureRequestDetails |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map |
applicationProperties |
private java.util.Map |
messageProperties |
private java.util.List |
objectRequestList |
static java.lang.String |
xmlVersionNumber |
| Constructor and Description |
|---|
XmlGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addApplicationProperties(java.util.Map properties)
Add application-specific properties to the XML document.
|
void |
addMessageProperties(java.util.Map properties)
Add message-specific properties to the XML document.
|
void |
addSignatureRequest(java.lang.String key,
java.lang.String bucketName,
java.util.Map metadata,
SignatureRequest signatureRequest)
Add a signature request item to the XML document to store the request, and details about
the object the request was related to.
|
private org.w3c.dom.Element |
createObjectElement(org.w3c.dom.Document document,
java.lang.String key,
java.lang.String bucketName,
java.util.Map metadata,
java.lang.String elementName)
Creates and element to contain information about an object.
|
private org.w3c.dom.Element |
createPropertyElement(org.w3c.dom.Document document,
java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String source)
Creates a Property XML element for a document.
|
private org.w3c.dom.Element |
createSignatureRequestElement(org.w3c.dom.Document document,
XmlGenerator.ObjectAndSignatureRequestDetails details)
Creates a SignatureRequest document element.
|
java.lang.String |
generateXml()
Generates an XML document containing metadata information as Property elements.
|
public static final java.lang.String xmlVersionNumber
private java.util.List objectRequestList
private java.util.Map applicationProperties
private java.util.Map messageProperties
public void addSignatureRequest(java.lang.String key,
java.lang.String bucketName,
java.util.Map metadata,
SignatureRequest signatureRequest)
key - the key name of the object the signature request applies to.bucketName - the bucket containing the object.metadata - the object's metadatasignatureRequest - the signature request for the object.public void addApplicationProperties(java.util.Map properties)
properties - public void addMessageProperties(java.util.Map properties)
properties - public java.lang.String generateXml()
throws java.lang.Exception
java.lang.Exceptionprivate org.w3c.dom.Element createPropertyElement(org.w3c.dom.Document document,
java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String source)
document - the document the property is being created for.propertyName - the property's name, becomes a name attribute of the element.propertyValue - the property's value, becomes the CDATA text value of the element. If this value
is null, the Property element is empty.source - text to describe the source of the information, such as userinput or parameter.
Becomes a source attribute of the element.private org.w3c.dom.Element createSignatureRequestElement(org.w3c.dom.Document document,
XmlGenerator.ObjectAndSignatureRequestDetails details)
document - details - private org.w3c.dom.Element createObjectElement(org.w3c.dom.Document document,
java.lang.String key,
java.lang.String bucketName,
java.util.Map metadata,
java.lang.String elementName)
document - key - bucketName - metadata - elementName -