public class

GDataContentHandler

extends Object
implements DataContentHandler
java.lang.Object
   ↳ com.google.gdata.data.media.GDataContentHandler

Class Overview

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).

Summary

Fields
private static final InputProperties DEFAULT_INPUT_PROPERTIES Defines the default InputProperties that are used for content parsing.
private static final OutputProperties DEFAULT_OUTPUT_PROPERTIES Defines the default OutputProperties that are used for content parsing.
private static final ThreadLocal<InputProperties> threadInputProperties Thread local storage that defines the input properties that should be used when parsing GData content
private static final ThreadLocal<OutputProperties> threadOutputProperties Thread local storage that defines the output properties that should be used when generating GData content
Public Constructors
GDataContentHandler()
Public Methods
Object getContent(DataSource ds)
static InputProperties getThreadInputProperties()
Returns the input properties for the current java.lang.Thread.
static OutputProperties getThreadOutputProperties()
Returns the output properties for the current java.lang.Thread.
Object getTransferData(DataFlavor df, DataSource ds)
DataFlavor[] getTransferDataFlavors()
static InputProperties setThreadInputProperties(InputProperties inputProperties)
Sets the input properties for the current java.lang.Thread and returns any existing input properties that have been set (so they can be restored later).
static OutputProperties setThreadOutputProperties(OutputProperties outputProperties)
Sets the output properties for the current java.lang.Thread and returns any existing input properties that have been set (so they can be restored later).
void writeTo(Object obj, String mimeType, OutputStream os)
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.activation.DataContentHandler

Fields

private static final InputProperties DEFAULT_INPUT_PROPERTIES

Defines the default InputProperties that are used for content parsing. These properties will use the default media registry, expect Atom content, produces generic Entry instances, and use an empty extension profile.

private static final OutputProperties DEFAULT_OUTPUT_PROPERTIES

Defines the default OutputProperties that are used for content parsing. These properties will use a default media registry and an empty extension profile.

private static final ThreadLocal<InputProperties> threadInputProperties

Thread local storage that defines the input properties that should be used when parsing GData content

private static final ThreadLocal<OutputProperties> threadOutputProperties

Thread local storage that defines the output properties that should be used when generating GData content

Public Constructors

public GDataContentHandler ()

Public Methods

public Object getContent (DataSource ds)

Parameters
ds
Throws
IOException

public static InputProperties getThreadInputProperties ()

Returns the input properties for the current java.lang.Thread.

public static OutputProperties getThreadOutputProperties ()

Returns the output properties for the current java.lang.Thread.

public Object getTransferData (DataFlavor df, DataSource ds)

Parameters
df
ds

public DataFlavor[] getTransferDataFlavors ()

public static InputProperties setThreadInputProperties (InputProperties inputProperties)

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

Parameters
inputProperties

public static OutputProperties setThreadOutputProperties (OutputProperties outputProperties)

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

Parameters
outputProperties

public void writeTo (Object obj, String mimeType, OutputStream os)

Parameters
obj
mimeType
os
Throws
IOException