org.apache.abdera.parser.stax
Class FOMContent

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMNodeImpl
      extended by org.apache.axiom.om.impl.llom.OMElementImpl
          extended by org.apache.abdera.parser.stax.FOMElement
              extended by org.apache.abdera.parser.stax.FOMExtensibleElement
                  extended by org.apache.abdera.parser.stax.FOMContent
All Implemented Interfaces:
Cloneable, Iterable<Element>, Base, Content, Element, ExtensibleElement, Constants, org.apache.axiom.om.impl.OMContainerEx, org.apache.axiom.om.impl.OMNodeEx, org.apache.axiom.om.OMConstants, org.apache.axiom.om.OMContainer, org.apache.axiom.om.OMElement, org.apache.axiom.om.OMNode

public class FOMContent
extends FOMExtensibleElement
implements Content


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.model.Content
Content.Type
 
Field Summary
protected  Content.Type type
           
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
attributes, DEFAULT_DEFAULT_NS_OBJECT, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns, qName
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
builder, done, factory, nextSibling, nodeType, parent, previousSibling
 
Fields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.abdera.util.Constants
ACCEPT, AID, ALTERNATE, APP_MEDIA_TYPE, APP_NS, APP_NS_PRE_RFC, APP_PREFIX, ATITLE, ATOM_MEDIA_TYPE, ATOM_NS, AURI, AUTHOR, BASE, CAT_MEDIA_TYPE, CATEGORIES, CATEGORY, CLASS, COLLECTION, CONFIG_FACTORY, CONFIG_PARSER, CONFIG_PARSERFACTORY, CONFIG_STREAMWRITER, CONFIG_WRITER, CONFIG_WRITERFACTORY, CONFIG_XPATH, CONTENT, CONTRIBUTOR, CONTROL, CONTROL_NS, CONTROL_PREFIX, DEFAULT_FACTORY, DEFAULT_PARSER, DEFAULT_PARSERFACTORY, DEFAULT_STREAMWRITER, DEFAULT_WRITER, DEFAULT_WRITERFACTORY, DEFAULT_XPATH, DIV, DRAFT, EDITED, EMAIL, ENTRY, ENTRY_MEDIA_TYPE, FEED, FEED_MEDIA_TYPE, FIXED, GENERATOR, HREF, HREFLANG, HTML, ICON, ID, LABEL, LANG, LENGTH, LINK, LN_ACCEPT, LN_ALTERNATE, LN_ALTERNATE_MULTIPART_RELATED, LN_AUTHOR, LN_BASE, LN_CATEGORIES, LN_CATEGORY, LN_CLASS, LN_COLLECTION, LN_CONTENT, LN_CONTRIBUTOR, LN_CONTROL, LN_DIV, LN_DRAFT, LN_EDITED, LN_EMAIL, LN_ENTRY, LN_FEED, LN_FIXED, LN_GENERATOR, LN_HREF, LN_HREFLANG, LN_ICON, LN_ID, LN_LABEL, LN_LANG, LN_LENGTH, LN_LINK, LN_LOGO, LN_NAME, LN_PUBLISHED, LN_REL, LN_RIGHTS, LN_SCHEME, LN_SERVICE, LN_SOURCE, LN_SPACE, LN_SRC, LN_SUBTITLE, LN_SUMMARY, LN_TERM, LN_TITLE, LN_TYPE, LN_UPDATED, LN_URI, LN_VERSION, LN_WORKSPACE, LOGO, MULTIPART_RELATED_TYPE, NAME, NAMED_PARSER, NAMED_WRITER, NO, PRE_RFC_ACCEPT, PRE_RFC_CATEGORIES, PRE_RFC_COLLECTION, PRE_RFC_CONTROL, PRE_RFC_DRAFT, PRE_RFC_EDITED, PRE_RFC_SERVICE, PRE_RFC_WORKSPACE, PREFIX, PREFIXED_TITLE, PUBLISHED, REL, RIGHTS, SCHEME, SERVICE, SOURCE, SPACE, SRC, STREAM_WRITER, SUBTITLE, SUMMARY, TERM, TEXT, TITLE, TYPE, UPDATED, URI, VERSION, WORKSPACE, XHTML, XHTML_NS, XML, XML_MEDIA_TYPE, XML_NS, YES
 
Fields inherited from interface org.apache.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
  FOMContent(Content.Type type)
           
protected FOMContent(Content.Type type, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
protected FOMContent(Content.Type type, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMXMLParserWrapper builder)
           
protected FOMContent(QName qname, Content.Type type, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
protected FOMContent(QName qname, Content.Type type, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMXMLParserWrapper builder)
           
protected FOMContent(String name, org.apache.axiom.om.OMNamespace namespace, Content.Type type, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
 
Method Summary
 Object clone()
          Clone this Base
 IRI getBaseUri()
          Returns the value of this element's xml:base attribute or null if xml:base is undefined.
 Content.Type getContentType()
          Returns the Content Type
 javax.activation.DataHandler getDataHandler()
          Attempts to Base64 decode the string value of the content element.
 String getLanguage()
          Returns the value of this elements xml:lang attribute or null if xml:lang is undefined.
 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 getResolvedBaseUri()
          Returns the current in-scope, fully qualified Base URI for this element.
 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.
<T extends Element>
T
setText(Content.Type type, String value)
           
<T extends Element>
T
setText(String value)
           
 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.parser.stax.FOMExtensibleElement
addExtension, addExtension, addExtension, addExtension, addExtension, addExtensions, addSimpleExtension, addSimpleExtension, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getSimpleExtension, getSimpleExtension
 
Methods inherited from class org.apache.abdera.parser.stax.FOMElement
_copyElement, _create, _getChildrenAsSet, _getElementValue, _getStringValue, _getUriValue, _parse, _removeAllChildren, _removeChildren, _resolve, _setChild, _setElementValue, addComment, complete, declareIfNecessary, declareNS, getAttributes, getAttributeValue, getAttributeValue, getDefaultWriterOptions, getDocument, getElements, getExtensionAttributes, getFactory, getFirstChild, getFirstChild, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getText, getText, getTextElement, getWrapped, isDeclared, iterator, removeAttribute, removeAttribute, selectLink, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setHtmlText, setLanguage, setMustPreserveWhitespace, setParentDocument, setParentElement, setText, setText, setTextElement, setTextText, setXhtmlText, setXhtmlText, toFormattedString, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
addAttribute, addAttribute, addChild, build, buildNext, buildWithAttachments, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, detach, discard, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getBuilder, getChildElements, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDefaultNamespace, getFirstChildWithName, getFirstElement, getFirstOMChild, getLineNumber, getLocalName, getNamespace, getNextOMSibling, getQName, getTextAsQName, getTrimmedText, getType, getXMLStreamReader, getXMLStreamReaderWithoutCaching, internalSerialize, internalSerialize, internalSerializeAndConsume, isComplete, notifyChildComplete, removeAttribute, resolveQName, setBuilder, setFirstChild, setLastChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, toString, toStringWithConsume
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
close, getOMFactory, getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.model.Element
declareNS, discard, getAttributes, getAttributeValue, getAttributeValue, getDocument, getElements, getExtensionAttributes, getFirstChild, getFirstChild, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getText, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setMustPreserveWhitespace, setParentElement, setText, setText
 
Methods inherited from interface org.apache.abdera.model.Base
addComment, complete, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.apache.axiom.om.OMElement
addAttribute, addAttribute, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getBuilder, getChildElements, getDefaultNamespace, getFirstElement, getLineNumber, getLocalName, getNamespace, getQName, getTextAsQName, getXMLStreamReader, getXMLStreamReaderWithoutCaching, removeAttribute, resolveQName, setBuilder, setFirstChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, toString, toStringWithConsume
 
Methods inherited from interface org.apache.axiom.om.OMNode
build, buildWithAttachments, close, detach, discard, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMContainer
addChild, buildNext, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, isComplete
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Field Detail

type

protected Content.Type type
Constructor Detail

FOMContent

public FOMContent(Content.Type type)

FOMContent

protected FOMContent(String name,
                     org.apache.axiom.om.OMNamespace namespace,
                     Content.Type type,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory)
              throws org.apache.axiom.om.OMException
Throws:
org.apache.axiom.om.OMException

FOMContent

protected FOMContent(QName qname,
                     Content.Type type,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory)

FOMContent

protected FOMContent(QName qname,
                     Content.Type type,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory,
                     org.apache.axiom.om.OMXMLParserWrapper builder)

FOMContent

protected FOMContent(Content.Type type,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory)
              throws org.apache.axiom.om.OMException
Throws:
org.apache.axiom.om.OMException

FOMContent

protected FOMContent(Content.Type type,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory,
                     org.apache.axiom.om.OMXMLParserWrapper builder)
Method Detail

getContentType

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

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

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

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

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

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

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

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

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

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

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

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

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

setText

public <T extends Element> T setText(Content.Type type,
                                     String value)

setText

public <T extends Element> T setText(String value)

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

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

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

getBaseUri

public IRI getBaseUri()
Description copied from interface: Element
Returns the value of this element's xml:base attribute or null if xml:base is undefined.

Specified by:
getBaseUri in interface Element
Overrides:
getBaseUri in class FOMElement
Returns:
The Base URI

getResolvedBaseUri

public IRI getResolvedBaseUri()
Description copied from interface: Element
Returns the current in-scope, fully qualified Base URI for this element.

Specified by:
getResolvedBaseUri in interface Element
Overrides:
getResolvedBaseUri in class FOMElement

getLanguage

public String getLanguage()
Description copied from interface: Element
Returns the value of this elements xml:lang attribute or null if xml:lang is undefined.

Specified by:
getLanguage in interface Element
Overrides:
getLanguage in class FOMElement
Returns:
The xml:lang value

clone

public Object clone()
Description copied from interface: Base
Clone this Base

Specified by:
clone in interface Base
Overrides:
clone in class FOMElement


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