com.google.gdata.data.media
Class GDataContentHandler

java.lang.Object
  extended by com.google.gdata.data.media.GDataContentHandler
All Implemented Interfaces:
javax.activation.DataContentHandler

public class GDataContentHandler
extends java.lang.Object
implements javax.activation.DataContentHandler

The GDataContentHandler class implements the DataContentHandler interface of the JavaBeans Activation Framework to enable the parsing and generation of Atom feed and entry XML from MIME media data. This data content handler is capable of generating MIME media output in Atom, RSS, and JSON formats, as well as parsing content in Atom format.

The implementation includes support for customized types driven by GData Kinds, where the type of object returned might be triggered by the GData kind category tags included within the content.

The current implentation does not include DataFlavor transfer support, only mapping from raw MIME data content to object model (and vice versa).


Nested Class Summary
static class GDataContentHandler.DataContext
          The DataContext class represents the (optional) contextual information that can be configured on a per-thread basis when parsing GData content using Java activation.
 
Constructor Summary
GDataContentHandler()
           
 
Method Summary
 java.lang.Object getContent(javax.activation.DataSource ds)
           
static GDataContentHandler.DataContext getThreadDataContext()
          Returns the DataContext for the current Thread.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df, javax.activation.DataSource ds)
           
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
           
static void setThreadDataContext(GDataContentHandler.DataContext dataContext)
          Sets the DataContext for the current Thread.
 void writeTo(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GDataContentHandler

public GDataContentHandler()
Method Detail

setThreadDataContext

public static void setThreadDataContext(GDataContentHandler.DataContext dataContext)
Sets the DataContext for the current Thread. If null, the default behavior is dynamic adaptation with extension profile creation and auto-extension.


getThreadDataContext

public static GDataContentHandler.DataContext getThreadDataContext()
Returns the DataContext for the current Thread. If null, the default behavior is dynamic adaptation with extension profile creation and auto-extension.


getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface javax.activation.DataContentHandler

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df,
                                        javax.activation.DataSource ds)
Specified by:
getTransferData in interface javax.activation.DataContentHandler

getContent

public java.lang.Object getContent(javax.activation.DataSource ds)
                            throws java.io.IOException
Specified by:
getContent in interface javax.activation.DataContentHandler
Throws:
java.io.IOException

writeTo

public void writeTo(java.lang.Object obj,
                    java.lang.String mimeType,
                    java.io.OutputStream os)
             throws java.io.IOException
Specified by:
writeTo in interface javax.activation.DataContentHandler
Throws:
java.io.IOException