# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.media
Class GDataContentHandler

    java.lang.Object
      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 implementation does not include DataFlavor transfer support, only mapping from raw MIME data content to object model (and vice versa).

Constructor Summary
`GDataContentHandler()`

Method Summary
`java.lang.Object` `getContent(javax.activation.DataSource ds)`
`static com.google.gdata.wireformats.input.InputProperties` `getThreadInputProperties()` Returns the input properties for the current `Thread`.
`static com.google.gdata.wireformats.output.OutputProperties` `getThreadOutputProperties()` Returns the output properties for the current `Thread`.
`java.lang.Object` `getTransferData(java.awt.datatransfer.DataFlavor df, javax.activation.DataSource ds)`
`java.awt.datatransfer.DataFlavor[]` `getTransferDataFlavors()`
`static com.google.gdata.wireformats.input.InputProperties` `setThreadInputProperties(com.google.gdata.wireformats.input.InputProperties inputProperties)` Sets the input properties for the current `Thread` and returns any existing input properties that have been set (so they can be restored later).
`static com.google.gdata.wireformats.output.OutputProperties` `setThreadOutputProperties(com.google.gdata.wireformats.output.OutputProperties outputProperties)` Sets the output properties for the current `Thread` and returns any existing input properties that have been set (so they can be restored later).
`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

### setThreadInputProperties

    public static com.google.gdata.wireformats.input.InputProperties setThreadInputProperties(com.google.gdata.wireformats.input.InputProperties inputProperties)

  Sets the input properties for the current `Thread` and returns any existing input properties that have been set (so they can be restored later).

### getThreadInputProperties

    public static com.google.gdata.wireformats.input.InputProperties getThreadInputProperties()

  Returns the input properties for the current `Thread`.

### setThreadOutputProperties

    public static com.google.gdata.wireformats.output.OutputProperties setThreadOutputProperties(com.google.gdata.wireformats.output.OutputProperties outputProperties)

  Sets the output properties for the current `Thread` and returns any existing input properties that have been set (so they can be restored later).

### getThreadOutputProperties

    public static com.google.gdata.wireformats.output.OutputProperties getThreadOutputProperties()

  Returns the output properties for the current `Thread`.

### 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`