Vordel SDK

com.vordel.mime
Class JSONBody

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

public class JSONBody
extends Body


Nested Class Summary
static class JSONBody.Factory
           
 
Field Summary
static ContentType CT_JSON
           
static java.lang.String JSON_MEDIA_TYPE
           
 
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
JSONBody(HeaderSet headers, ContentType contentType, org.codehaus.jackson.JsonNode json)
           
 
Method Summary
 boolean contentAvailable()
           
static JSONBody createBody()
           
 org.codehaus.jackson.JsonNode getJSON()
           
static org.codehaus.jackson.JsonNode getJSON(Message m)
           
 org.codehaus.jackson.JsonNode getJsonNode()
           
static JSONBody locate(Message m)
           
protected  void parse(java.io.InputStream is)
          Parse a body from a specific InputStream.
protected  void purgeContent()
          Bodies are purged() when they are no longer in use.
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSON_MEDIA_TYPE

public static final java.lang.String JSON_MEDIA_TYPE
See Also:
Constant Field Values

CT_JSON

public static final ContentType CT_JSON
Constructor Detail

JSONBody

public JSONBody(HeaderSet headers,
                ContentType contentType,
                org.codehaus.jackson.JsonNode json)
Method Detail

getJsonNode

public org.codehaus.jackson.JsonNode getJsonNode()

createBody

public static JSONBody createBody()

getJSON

public org.codehaus.jackson.JsonNode getJSON()
                                      throws java.io.IOException
Throws:
java.io.IOException

getJSON

public static org.codehaus.jackson.JsonNode getJSON(Message m)
                                             throws java.io.IOException
Throws:
java.io.IOException

locate

public static JSONBody locate(Message m)
                       throws java.io.IOException
Throws:
java.io.IOException

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

parse

protected void parse(java.io.InputStream is)
              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()

purgeContent

protected 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

contentAvailable

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

Vordel SDK


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