org.newsml.toolkit
Interface ContentItem

All Superinterfaces:
BaseNode, CatalogNode, CommentNode, EquivalentNode, HrefNode, IdNode

public interface ContentItem
extends BaseNode, CatalogNode, CommentNode, EquivalentNode, HrefNode, IdNode

News content for presentation to humans.

A content item represents a leaf node in the NewsML content tree: it either contains or points to actual content, such as a textual news story, a photo, or a video. If the content item contains the content, the content will be accessible through the getDataContent() method; otherwise, the content's URL will be available through the HrefNode.getHref() method.

The getMediaType(), getFormat(), and getNotation() methods all provide redundant information already available through getMimeType(), and provide that information in ways that will be less familiar to users; these redundant methods have been included only for the sake of completeness.

Version:
2.0
Author:
Reuters PLC

Method Summary
 Characteristics getCharacteristics()
          Get the physical characteristics of the news content.
 DataContent getDataContent()
          Get raw inline content.
 Encoding getEncoding()
          Get an encoding step for the raw inline content.
 FormalName getFormat()
          Get the content's format.
 FormalName getMediaType()
          Get the content's media type.
 FormalName getMimeType()
          Return the content's MIME type.
 FormalName getNotation()
          Get the content's data type notation.
 
Methods inherited from interface org.newsml.toolkit.BaseNode
getAttr, getChild, getChild, getChild, getChild, getChildCount, getChildCount, getParent, getPath, getSession, getXMLName, getXPath, insertAfter, insertAfter, insertAfter, insertAfter, insertAfterDuid, insertAfterDuid, insertBefore, insertBefore, insertBefore, insertBefore, insertBeforeDuid, insertBeforeDuid, insertChild, insertChild, insertFirst, insertFirst, insertLast, insertLast, removeChild, removeChild, removeSelf, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, setAttr, setAttr, toXML, toXML, unsetAttr, unsetAttr, writeXML, writeXML
 
Methods inherited from interface org.newsml.toolkit.CatalogNode
getCatalog
 
Methods inherited from interface org.newsml.toolkit.CommentNode
getComment, getComment, getCommentCount
 
Methods inherited from interface org.newsml.toolkit.EquivalentNode
getBasisForChoiceNodes
 
Methods inherited from interface org.newsml.toolkit.HrefNode
getHref
 
Methods inherited from interface org.newsml.toolkit.IdNode
getDuid, getEuid
 

Method Detail

getMediaType

public FormalName getMediaType()
Get the content's media type.

NewsML media type information is redundant, filling the same function as the first part of the MIME type (see getMimeType()). Typical media types include Text, Audio, Video, and Image.

Returns:
A formal name representing the media type, or null if no media type was specified.
See Also:
getMimeType()

getFormat

public FormalName getFormat()
Get the content's format.

NewsML format information is redundant, filling the same function as the second part of the MIME type (see getMimeType()). Typical media types include ANPA 1312 and NITF.

Returns:
A formal name describing the format, or null if no format was specified.
See Also:
getMimeType()

getMimeType

public FormalName getMimeType()
Return the content's MIME type.

While this value is a formal name, and may be defined by any vocabulary according to the NewsML document type, it would be a very poor choice for a provider not to use the proper MIME-type definition in IETF RFC 2045.

Returns:
A formal name describing the MIME type, or null if no MIME type was specified.
See Also:
getCharacteristics()

getNotation

public FormalName getNotation()
Get the content's data type notation.

NewsML notation information is redundant, filling the same role as the MIME type (see getMimeType()) but using a less familiar representation.

Returns:
A formal name describing the data type notation, or null if no notation was specified.
See Also:
getMimeType()

getCharacteristics

public Characteristics getCharacteristics()
Get the physical characteristics of the news content.

Physical characteristics include the physical content's size in bytes. Note that information on media and format is provided by the MIME type (see getMimeType()).

Returns:
An object describing the physical characteristics, or null if none was specified.
See Also:
getMimeType()

getEncoding

public Encoding getEncoding()
Get an encoding step for the raw inline content.

The encoding step will eventually lead to DataContent, possibly through one or more further encoding steps.

This method, HrefNode.getHref(), and getDataContent() are mutually exclusive; only one may return a non-null value.

Returns:
The encoding step, or null if no intermediate encoding steps were performed on the raw, inline data (or if the data is referenced out of line).

getDataContent

public DataContent getDataContent()
Get raw inline content.

This method, HrefNode.getHref(), and getEncoding() are mutually exclusive; only one may return a non-null value.

Returns:
The inline content, or null if an intermediate encoding step was performed on the data (or if the data is referenced out of line).