com.ibm.portal.resolver.data
Interface JsonDataSource

All Superinterfaces:
Addressable, DataSource, DataSourceFragment, Disposable, TimeStamped

public interface JsonDataSource
extends DataSource

Implemented by providers of Json data streams. The data provider streams the data to the JsonContentHandler.

Since:
7.0.0.1
Note:
This interface is designed to be implemented by clients.

Field Summary
static java.lang.String CONTENT_TYPE_JSON
          Mime type for JSON content as defined in RFC 4627
static java.lang.String CONTENT_TYPE_JSON_UTF8
          Mime type for json messages using UTF-8 character encoding
static java.lang.String KEY_CHARSET
          Name of the mime key that specifies the characterset
 
Fields inherited from interface com.ibm.portal.resolver.data.DataSource
CONTENT_TYPE_UNKNOWN, CREATION_UNKNOWN, EXPIRATION_UNKNOWN, LAST_MODIFICATION_UNKNOWN, MAX_AGE_INFINITE, MAX_AGE_NONE, ROOT_DATE
 
Fields inherited from interface com.ibm.portal.resolver.data.Addressable
EMPTY_PARAMETERS
 
Method Summary
 java.lang.String getContentType()
          Mime type of the data.
 DefaultJsonContentHandler write(DefaultJsonContentHandler out)
          Copies the complete data onto the target handler.
 
Methods inherited from interface com.ibm.portal.resolver.data.DataSource
getCreated, getExpiration, getLastModified
 
Methods inherited from interface com.ibm.portal.resolver.data.Addressable
getParameters, getURI
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Field Detail

CONTENT_TYPE_JSON

static final java.lang.String CONTENT_TYPE_JSON
Mime type for JSON content as defined in RFC 4627


CONTENT_TYPE_JSON_UTF8

static final java.lang.String CONTENT_TYPE_JSON_UTF8
Mime type for json messages using UTF-8 character encoding


KEY_CHARSET

static final java.lang.String KEY_CHARSET
Name of the mime key that specifies the characterset

See Also:
Constant Field Values
Method Detail

getContentType

java.lang.String getContentType()
Mime type of the data. The return value must be a valid json mime-type, e.g. "application/json". The mime type may contain a charset parameter to indicate the character set when serializing to a byte stream, e.g. "application/json; charset=UTF-8"

Specified by:
getContentType in interface DataSource
Returns:
mime type string, not null

write

DefaultJsonContentHandler write(DefaultJsonContentHandler out)
                                throws java.io.IOException
Copies the complete data onto the target handler.

Parameters:
out - target handler to receive the data.
Returns:
reference to the target handler to allow for method chaining
Throws:
java.io.IOException - - if the copy operation failed