|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Content
Represents an atom:content element.
Atom has a very clearly defined and extremely flexible content model. The model allows for five basic types of content:
<content type="text"><content></content>
is interpreted as literal characer "<" followed by the word "content",
followed by the literal character ">".<content type="html"><b>content</b></content>
is interpreted as the word "content" surrounded by the HTML <b>
and </b>
tags.<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><b>Content</b></div></content>
.<content type="application/xml"><a xmlns="..."><b><c/></b></a></content>
.
The content could, alternatively, be linked to via the src attribute,
<content type="application/xml" src="http://example.org/foo.xml"/>
.<content type="text/calendar">BEGIN:VCALENDAR...</content>
.<content type="image/jpeg">{Base64}</content>
.<content type="text/calendar" src="http://example.org/foo.cal"/>
,
<content type="image/jpeg" src="http://example.org/foo.jpg" />
Per RFC4287:
The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive. atomInlineTextContent = element atom:content { atomCommonAttributes, attribute type { "text" | "html" }?, (text)* } atomInlineXHTMLContent = element atom:content { atomCommonAttributes, attribute type { "xhtml" }, xhtmlDiv } atomInlineOtherContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, (text|anyElement)* } atomOutOfLineContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, attribute src { atomUri }, empty } atomContent = atomInlineTextContent | atomInlineXHTMLContent | atomInlineOtherContent | atomOutOfLineContent
Nested Class Summary | |
---|---|
static class |
Content.Type
|
Method Summary | ||
---|---|---|
Content.Type |
getContentType()
|
|
javax.activation.DataHandler |
getDataHandler()
Attempts to Base64 decode the string value of the content element. |
|
javax.activation.MimeType |
getMimeType()
RFC4287: On the atom:content element, the value of the "type" attribute MAY be one of "text", "html", or "xhtml". |
|
java.net.URI |
getResolvedSrc()
Returns the fully qualified URI form of the content src attribute. |
|
java.net.URI |
getSrc()
RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference. |
|
java.lang.String |
getValue()
|
|
|
getValueElement()
|
|
java.lang.String |
getWrappedValue()
|
|
void |
setContentType(Content.Type type)
|
|
void |
setDataHandler(javax.activation.DataHandler dataHandler)
Sets the string value of the content element by Base64 encoding the specifed byte array. |
|
void |
setMimeType(java.lang.String type)
RFC4287: On the atom:content element, the value of the "type" attribute MAY be one of "text", "html", or "xhtml". |
|
void |
setSrc(java.lang.String src)
RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference. |
|
void |
setValue(java.lang.String value)
|
|
|
setValueElement(T value)
|
|
void |
setWrappedValue(java.lang.String wrappedValue)
|
Methods inherited from interface org.apache.abdera.model.Element |
---|
discard, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDocument, getExtensionAttributes, getFirstChild, getFirstChild, getLanguage, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setParentElement, setText |
Methods inherited from interface org.apache.abdera.model.Base |
---|
clone, getFactory, writeTo, writeTo |
Method Detail |
---|
Content.Type getContentType()
void setContentType(Content.Type type)
<T extends Element> T getValueElement()
<T extends Element> void setValueElement(T value)
javax.activation.MimeType getMimeType()
void setMimeType(java.lang.String type) throws javax.activation.MimeTypeParseException
javax.activation.MimeTypeParseException
java.net.URI getSrc() throws java.net.URISyntaxException
RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference. If the "src" attribute is present, atom:content MUST be empty. Atom Processors MAY use the IRI to retrieve the content and MAY choose to ignore remote content or to present it in a different manner than local content.
If the "src" attribute is present, the "type" attribute SHOULD be provided and MUST be a MIME media type, rather than "text", "html", or "xhtml".
java.net.URISyntaxException
java.net.URI getResolvedSrc() throws java.net.URISyntaxException
java.net.URISyntaxException
void setSrc(java.lang.String src) throws java.net.URISyntaxException
RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference. If the "src" attribute is present, atom:content MUST be empty. Atom Processors MAY use the IRI to retrieve the content and MAY choose to ignore remote content or to present it in a different manner than local content.
If the "src" attribute is present, the "type" attribute SHOULD be provided and MUST be a MIME media type, rather than "text", "html", or "xhtml".
java.net.URISyntaxException
javax.activation.DataHandler getDataHandler()
java.lang.UnsupportedOperationException
- if type = text, html, xhtml, or any application/*+xml, or text/* typevoid setDataHandler(javax.activation.DataHandler dataHandler)
java.lang.UnsupportedOperationException
- if type = text, html, xhtml, or any application/*+xml, or text/* typejava.lang.String getValue()
void setValue(java.lang.String value)
java.lang.String getWrappedValue()
void setWrappedValue(java.lang.String wrappedValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |