Vordel SDK

com.vordel.mime
Class XMLBody

java.lang.Object
  extended by com.vordel.mime.Body
      extended by com.vordel.mime.XMLBody
All Implemented Interfaces:
com.vordel.system.Disposable

public class XMLBody
extends Body

Represents an XML bodypart. The body is generally treated as a DOM {#link Document} and parsing this involves invoking the JAX parser.

See Also:
Body, BodyFactory

Nested Class Summary
static class XMLBody.Factory
           
 
Field Summary
 
Fields inherited from class com.vordel.mime.Body
CAN_INVALIDATE, contentType, CT_APP_OCTET_STREAM, CT_DEFAULT, CT_MULTIPART_RELATED, CT_TEXT_PLAIN, CT_TEXT_XML_UTF8, CT_XOP_APPLICATION_XML, PUSH_WRITE, REMOVE_XFER_ENCODING_ON_WRITE_DEPRECATED, RETAIN_XFER_ENCODING_ON_READ, WRITE_NO_CTE
 
Constructor Summary
XMLBody(HeaderSet headers, ContentType contentType, org.w3c.dom.Document doc)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean contentAvailable()
           
 org.w3c.dom.Document getDocument()
           
static org.w3c.dom.Document getDocument(Message m)
           
static XMLBody locate(Message m)
          Locate the XML Body from the message content if it exists.
 void parse(java.io.InputStream input)
          Parse a body from a specific InputStream.
 void purgeContent()
          Bodies are purged() when they are no longer in use.
 void setDocument(org.w3c.dom.Document doc)
           
 void setStylesheet(javax.xml.transform.Templates stylesheet)
          Supply a stylesheet to be used when writing the content of this document.
 void writeContent(java.io.OutputStream os, int flags)
          Write the content of the body to the specified OutputStream This is similar to Body.write(java.io.OutputStream, int), but does not include the headers for the body.
 
Methods inherited from class com.vordel.mime.Body
bufferInput, create, dispose, fini, getContentEncoding, getContentId, getContentLength, getContentType, getHeaders, getInputStream, getParent, getSource, initSource, parse, registerFactory, setParent, sevenbit, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBody

public XMLBody(HeaderSet headers,
               ContentType contentType,
               org.w3c.dom.Document doc)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

contentAvailable

public boolean contentAvailable()
Specified by:
contentAvailable in class Body

setStylesheet

public void setStylesheet(javax.xml.transform.Templates stylesheet)
Supply a stylesheet to be used when writing the content of this document.

Parameters:
stylesheet - The stylesheet to apply.
See Also:
writeContent(java.io.OutputStream, int), Body.write(java.io.OutputStream, int)

purgeContent

public void purgeContent()
Description copied from class: Body
Bodies are purged() when they are no longer in use. This provides similar functionality to the "finalize()" method, but may be called by any caller, or in any thread, when it is known that a body is no longer in use.

Specified by:
purgeContent in class Body

getDocument

public static org.w3c.dom.Document getDocument(Message m)
                                        throws java.io.IOException
Throws:
java.io.IOException

locate

public static XMLBody locate(Message m)
                      throws java.io.IOException
Locate the XML Body from the message content if it exists.

Parameters:
m - The Message in which to locate the XML Body
Returns:
The XMLBody, or null if it doesn't exist
Throws:
java.io.IOException

parse

public void parse(java.io.InputStream input)
           throws java.io.IOException
Description copied from class: Body
Parse a body from a specific InputStream.

This should be considered "private" to callers: it must be invoked via Body.parse()

Specified by:
parse in class Body
Throws:
java.io.IOException
See Also:
Body.parse()

getDocument

public org.w3c.dom.Document getDocument()
                                 throws java.io.IOException
Throws:
java.io.IOException

setDocument

public void setDocument(org.w3c.dom.Document doc)

writeContent

public void writeContent(java.io.OutputStream os,
                         int flags)
                  throws java.io.IOException
Description copied from class: Body
Write the content of the body to the specified OutputStream This is similar to Body.write(java.io.OutputStream, int), but does not include the headers for the body.

Specified by:
writeContent in class Body
Throws:
java.io.IOException

Vordel SDK


This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel