ContentProvider Objects

Stores and retrieves content for an application. Content is identified using tags defined by the application. It is the application's responsibility to ensure that tags are unique, and a class-like naming schme is recommended, e.g. x.y.z....

c.getContent(tag) : Object

tag (string) : the content tag

Returns the content identified by the specified tag or None if the tag is unknown to this provider. The type of the result is determined by the content format.

c.getContentAsBinary(tag) : byte[]

tag (string) : the content tag

Returns the binary content identified by the specified tag or None if the tag is unknown to this provider or the content does not have binary format.

c.getContentAsUTF8(tag) : string

tag (string) : the content tag

Returns the string content identified by the specified tag or None if the tag is unknown to this provider or the content does not have string format.

c.getContentFormat(tag) : ContentFormat

tag (string) : the content tag

Returns the format of the content identfied by the specified tag or None if the tag is unknown to this provider. The format determines the content type.

c.getContentTagIterator() : Iterator

Returns an iterator over the content tags known to this provider.

c.isContentCurrent(tag) : boolean

tag (string) : the content tag

Returns True if the specified content is considered current (up-to-date) with respect to its context, e.g. its containing stream. Returns False if the content tag is unknown to this provider, or as a hint that the content may be stale.

c.putContent(tag, format, content)

tag (string) : the content tag

format (ContentFormat) : the content format

content (Object) : the content

Stores content in this provider with the specified tag and format. The content must not be None and its type must be compatible with the format. Any existing content with the same tag is replaced.

c.putContentAsBinary(tag, content)

tag (string) : the content tag

content (byte[]) : the content

Stores binary content in this provider under the specified tag. The content must not be None.

c.putContentAsUTF8(tag, content)

tag (string) : the content tag

content (string) : the content

Stores string content in this provider under the specified tag. The content must not be None.

c.removeContent(tag)

tag (string) : the content tag

Removes any content stored by this provider under the specified tag.