org.apache.abdera.model
Interface Content

All Superinterfaces:
Base, java.lang.Cloneable, Element, java.io.Serializable

public interface Content
extends Element

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:

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()
           
<T extends Element>
T
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)
           
<T extends Element>
void
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

getContentType

Content.Type getContentType()

setContentType

void setContentType(Content.Type type)

getValueElement

<T extends Element> T getValueElement()

setValueElement

<T extends Element> void setValueElement(T value)

getMimeType

javax.activation.MimeType getMimeType()
RFC4287: On the atom:content element, the value of the "type" attribute MAY be one of "text", "html", or "xhtml". Failing that, it MUST conform to the syntax of a MIME media type, but MUST NOT be a composite type. If neither the type attribute nor the src attribute is provided, Atom Processors MUST behave as though the type attribute were present with a value of "text".

Returns:
null if type = text, html or xhtml

setMimeType

void setMimeType(java.lang.String type)
                 throws javax.activation.MimeTypeParseException
RFC4287: On the atom:content element, the value of the "type" attribute MAY be one of "text", "html", or "xhtml". Failing that, it MUST conform to the syntax of a MIME media type, but MUST NOT be a composite type. If neither the type attribute nor the src attribute is provided, Atom Processors MUST behave as though the type attribute were present with a value of "text".

Throws:
javax.activation.MimeTypeParseException

getSrc

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

Throws:
java.net.URISyntaxException

getResolvedSrc

java.net.URI getResolvedSrc()
                            throws java.net.URISyntaxException
Returns the fully qualified URI form of the content src attribute.

Throws:
java.net.URISyntaxException

setSrc

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

Throws:
java.net.URISyntaxException

getDataHandler

javax.activation.DataHandler getDataHandler()
Attempts to Base64 decode the string value of the content element.

Throws:
java.lang.UnsupportedOperationException - if type = text, html, xhtml, or any application/*+xml, or text/* type

setDataHandler

void setDataHandler(javax.activation.DataHandler dataHandler)
Sets the string value of the content element by Base64 encoding the specifed byte array.

Throws:
java.lang.UnsupportedOperationException - if type = text, html, xhtml, or any application/*+xml, or text/* type

getValue

java.lang.String getValue()

setValue

void setValue(java.lang.String value)

getWrappedValue

java.lang.String getWrappedValue()

setWrappedValue

void setWrappedValue(java.lang.String wrappedValue)