org.apache.abdera.ext.rss
Class RssContent

java.lang.Object
  extended by org.apache.abdera.model.ElementWrapper
      extended by org.apache.abdera.ext.rss.RssContent
All Implemented Interfaces:
Cloneable, Iterable<Element>, Base, Content, Element

public class RssContent
extends ElementWrapper
implements Content


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.model.Content
Content.Type
 
Constructor Summary
RssContent(Element internal)
           
RssContent(Factory factory, QName qname)
           
 
Method Summary
 Content.Type getContentType()
          Returns the Content Type
 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".
 IRI getResolvedSrc()
          Returns the fully qualified URI form of the content src attribute.
 IRI getSrc()
           RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference.
 String getValue()
          Returns the string value of this atom:content element
<T extends Element>
T
getValueElement()
          Return the value element or null if type="text", type="html" or type is some non-XML media type
 String getWrappedValue()
          Return the string value of the atom:content element with the enclosing div tag if type="xhtml"
 Content setContentType(Content.Type type)
          Set the Content Type
 Content setDataHandler(javax.activation.DataHandler dataHandler)
          Sets the string value of the content element by Base64 encoding the specifed byte array.
 Content setMimeType(String type)
          RFC4287: On the atom:content element, the value of the "type" attribute MAY be one of "text", "html", or "xhtml".
 Content setSrc(String src)
           RFC4287: atom:content MAY have a "src" attribute, whose value MUST be an IRI reference.
 Content setValue(String value)
          Set the string value of the atom:content element
<T extends Element>
Content
setValueElement(T value)
          Set the value element of the content.
 Content setWrappedValue(String wrappedValue)
          Set the string value of the atom:content with the enclosing div tag
 
Methods inherited from class org.apache.abdera.model.ElementWrapper
addComment, clone, complete, declareNS, discard, equals, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDefaultWriterOptions, getDocument, getElements, getExtensionAttributes, getFactory, getFirstChild, getFirstChild, getInternal, getLanguage, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, hashCode, iterator, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setMustPreserveWhitespace, setParentElement, setText, setText, toString, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.model.Element
declareNS, discard, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDocument, getElements, getExtensionAttributes, getFirstChild, getFirstChild, getLanguage, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setMustPreserveWhitespace, setParentElement, setText, setText
 
Methods inherited from interface org.apache.abdera.model.Base
addComment, clone, complete, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

RssContent

public RssContent(Element internal)

RssContent

public RssContent(Factory factory,
                  QName qname)
Method Detail

getContentType

public Content.Type getContentType()
Description copied from interface: Content
Returns the Content Type

Specified by:
getContentType in interface Content
Returns:
The Content Type

getDataHandler

public javax.activation.DataHandler getDataHandler()
Description copied from interface: Content
Attempts to Base64 decode the string value of the content element.

Specified by:
getDataHandler in interface Content
Returns:
A DataHandler or null

getMimeType

public javax.activation.MimeType getMimeType()
Description copied from interface: Content
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".

Specified by:
getMimeType in interface Content
Returns:
null if type = text, html or xhtml, otherwise a media type

getResolvedSrc

public IRI getResolvedSrc()
Description copied from interface: Content
Returns the fully qualified URI form of the content src attribute.

Specified by:
getResolvedSrc in interface Content
Returns:
The IRI value of the src attribute resolved against the in-scope Base URI

getSrc

public IRI getSrc()
Description copied from interface: Content

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

Specified by:
getSrc in interface Content
Returns:
The IRI value of the src attribute or null if none

getValue

public String getValue()
Description copied from interface: Content
Returns the string value of this atom:content element

Specified by:
getValue in interface Content
Returns:
The string value

getValueElement

public <T extends Element> T getValueElement()
Description copied from interface: Content
Return the value element or null if type="text", type="html" or type is some non-XML media type

Specified by:
getValueElement in interface Content
Returns:
The first child element of the atom:content element or null

getWrappedValue

public String getWrappedValue()
Description copied from interface: Content
Return the string value of the atom:content element with the enclosing div tag if type="xhtml"

Specified by:
getWrappedValue in interface Content
Returns:
The div wrapped value

setContentType

public Content setContentType(Content.Type type)
Description copied from interface: Content
Set the Content Type

Specified by:
setContentType in interface Content
Parameters:
type - The Content Type

setDataHandler

public Content setDataHandler(javax.activation.DataHandler dataHandler)
Description copied from interface: Content
Sets the string value of the content element by Base64 encoding the specifed byte array.

Specified by:
setDataHandler in interface Content
Parameters:
dataHandler - The DataHandler for the binary content requiring Base64 encoding

setMimeType

public Content setMimeType(String type)
Description copied from interface: Content
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".

Specified by:
setMimeType in interface Content
Parameters:
type - The media type

setSrc

public Content setSrc(String src)
Description copied from interface: Content

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

Specified by:
setSrc in interface Content
Parameters:
src - The IRI to use as the src attribute value for the content

setValue

public Content setValue(String value)
Description copied from interface: Content
Set the string value of the atom:content element

Specified by:
setValue in interface Content
Parameters:
value - The string value

setValueElement

public <T extends Element> Content setValueElement(T value)
Description copied from interface: Content
Set the value element of the content. If the value is a Div, the type attribute will be set to type="xhtml", otherwise, the attribute will be set to type="application/xml"

Specified by:
setValueElement in interface Content
Parameters:
value - The element to set

setWrappedValue

public Content setWrappedValue(String wrappedValue)
Description copied from interface: Content
Set the string value of the atom:content with the enclosing div tag

Specified by:
setWrappedValue in interface Content
Parameters:
wrappedValue - The string value with the wrapping div tag


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.