org.apache.abdera.parser.stax
Class FOMElement

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
All Implemented Interfaces:
Cloneable, Iterable<Element>, Base, Element, 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
Direct Known Subclasses:
FOMDateTime, FOMExtensibleElement, FOMGenerator, FOMIRI, FOMText

public class FOMElement
extends org.apache.axiom.om.impl.llom.OMElementImpl
implements Element, org.apache.axiom.om.OMElement, Constants


Field Summary
 
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
  FOMElement(QName qname)
           
protected FOMElement(QName qname, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
protected FOMElement(QName qname, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMXMLParserWrapper builder)
           
protected FOMElement(String name, org.apache.axiom.om.OMNamespace namespace, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
 
Method Summary
protected  org.apache.axiom.om.OMElement _copyElement(org.apache.axiom.om.OMElement src, org.apache.axiom.om.OMElement dest)
           
protected  org.apache.axiom.om.OMElement _create(org.apache.axiom.om.OMElement src)
           
protected
<E extends Element>
List<E>
_getChildrenAsSet(QName qname)
           
protected  String _getElementValue(QName qname)
           
protected  String _getStringValue(IRI uri)
           
protected  IRI _getUriValue(String v)
           
protected  Element _parse(String value, IRI baseUri)
           
protected  void _removeAllChildren()
           
protected  void _removeChildren(QName qname, boolean many)
           
protected  IRI _resolve(IRI base, IRI value)
           
protected  void _setChild(QName qname, org.apache.axiom.om.OMElement element)
           
protected  void _setElementValue(QName qname, String value)
           
<T extends Base>
T
addComment(String value)
          Add an XML comment to this Base
 Object clone()
          Clone this Base
<T extends Base>
T
complete()
          Ensure that the underlying streams are fully parsed.
protected  void declareIfNecessary(String ns, String prefix)
           
<T extends Element>
T
declareNS(String uri, String prefix)
          Declare a namespace
 List<QName> getAttributes()
          Returns a listing of all attributes on this element
 String getAttributeValue(QName qname)
          Returns the value of the named attribute
 String getAttributeValue(String name)
          Returns the value of the named attribute
 IRI getBaseUri()
          Returns the value of this element's xml:base attribute or null if xml:base is undefined.
 WriterOptions getDefaultWriterOptions()
          Get the default WriterOptions for this object
<T extends Element>
Document<T>
getDocument()
          Returns the document to which this element belongs
<T extends Element>
List<T>
getElements()
          Return a listing of this elements child elements
 List<QName> getExtensionAttributes()
          Returns a listing of extension attributes on this element (extension attributes are attributes whose namespace URI is different than the elements)
 Factory getFactory()
          Get the Factory used to create this Base
<T extends Element>
T
getFirstChild()
          Get the first child element
<T extends Element>
T
getFirstChild(QName qname)
          Get the first child element with the given QName
 String getLanguage()
          Returns the value of this elements xml:lang attribute or null if xml:lang is undefined.
 Lang getLanguageTag()
          Returns the value of the xml:lang attribute as a Lang object
 Locale getLocale()
          Returns a Locale object created from the xml:lang attribute
 boolean getMustPreserveWhitespace()
          Return true if insignificant whitespace must be preserved
 Map<String,String> getNamespaces()
          Return a map listing the xml namespaces declared for this element
<T extends Element>
T
getNextSibling()
          Get the element following this one
<T extends Element>
T
getNextSibling(QName qname)
          Get the first following sibling with the specified QName
<T extends Base>
T
getParentElement()
          Return this Element's parent element or document
<T extends Element>
T
getPreviousSibling()
          Get the element preceding this one
<T extends Element>
T
getPreviousSibling(QName qname)
          Get the first previous sibling with the specified QName
 IRI getResolvedBaseUri()
          Returns the current in-scope, fully qualified Base URI for this element.
 String getText()
          Returns the Text value of this element
protected  String getText(QName qname)
           
protected
<T extends Text>
T
getTextElement(QName qname)
           
protected  Element getWrapped(Element internal)
           
protected  boolean isDeclared(String ns, String prefix)
           
 Iterator<Element> iterator()
          Iterate over all child elements
<T extends Element>
T
removeAttribute(QName qname)
          Remove the named Attribute
<T extends Element>
T
removeAttribute(String name)
          Remove the named attribute
protected  Link selectLink(List<Link> links, String type, String hreflang)
           
<T extends Element>
T
setAttributeValue(QName qname, String value)
          Sets the value of the named attribute
<T extends Element>
T
setAttributeValue(String name, String value)
          Sets the value of the named attribute
<T extends Element>
T
setBaseUri(IRI base)
          Sets the value of this element's xml:base attribute.
<T extends Element>
T
setBaseUri(String base)
          Sets the value of this element's xml:base attribute.
protected  Text setHtmlText(QName qname, String value, IRI baseUri)
           
<T extends Element>
T
setLanguage(String language)
          Sets the value of this elements xml:lang attribute.
<T extends Element>
T
setMustPreserveWhitespace(boolean preserve)
          Set to true to preserve insignificant whitespace
protected  void setParentDocument(Document parent)
           
<T extends Element>
T
setParentElement(Element parent)
          Set this Element's parent element
<T extends Element>
T
setText(javax.activation.DataHandler handler)
          Set the Text value of this element using the data handler
 void setText(String text)
          Set the Text value of this element
protected
<T extends Text>
void
setTextElement(QName qname, T text, boolean many)
           
protected  Text setTextText(QName qname, String value)
           
protected  Text setXhtmlText(QName qname, Div value, IRI baseUri)
           
protected  Text setXhtmlText(QName qname, String value, IRI baseUri)
           
 String toFormattedString()
           
 void writeTo(OutputStream out)
          Serializes the model component out to the specified stream
 void writeTo(OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream
 void writeTo(String writer, OutputStream out)
          Serializes the model component out to the specified stream using the given Abdera writer
 void writeTo(String writer, OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream using the given abdera writer
 void writeTo(String writer, Writer out)
          Serializes the model component out to the specified java.io.Writer using the given Abdera writer
 void writeTo(String writer, Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer using the given abdera writer
 void writeTo(Writer writer)
          Serializes the model component out to the specified writer
 void writeTo(Writer writer, OutputStream out)
          Serializes the model component out to the specified stream using the given Abdera writer
 void writeTo(Writer writer, OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream using the given abdera writer
 void writeTo(Writer writer, Writer out)
          Serializes the model component out to the specified java.io.Writer using the given Abdera writer
 void writeTo(Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer
 void writeTo(Writer writer, Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer using the given abdera writer
 
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
discard, getQName
 
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
 

Constructor Detail

FOMElement

public FOMElement(QName qname)

FOMElement

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

FOMElement

protected FOMElement(QName qname,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory)
              throws org.apache.axiom.om.OMException
Throws:
org.apache.axiom.om.OMException

FOMElement

protected FOMElement(QName qname,
                     org.apache.axiom.om.OMContainer parent,
                     org.apache.axiom.om.OMFactory factory,
                     org.apache.axiom.om.OMXMLParserWrapper builder)
Method Detail

getWrapped

protected Element getWrapped(Element internal)

getParentElement

public <T extends Base> T getParentElement()
Description copied from interface: Element
Return this Element's parent element or document

Specified by:
getParentElement in interface Element
Returns:
The parent

setParentDocument

protected void setParentDocument(Document parent)

setParentElement

public <T extends Element> T setParentElement(Element parent)
Description copied from interface: Element
Set this Element's parent element

Specified by:
setParentElement in interface Element
Parameters:
parent - The parent element

getPreviousSibling

public <T extends Element> T getPreviousSibling()
Description copied from interface: Element
Get the element preceding this one

Specified by:
getPreviousSibling in interface Element
Returns:
The preceding sibling

getNextSibling

public <T extends Element> T getNextSibling()
Description copied from interface: Element
Get the element following this one

Specified by:
getNextSibling in interface Element
Returns:
The following sibling

getFirstChild

public <T extends Element> T getFirstChild()
Description copied from interface: Element
Get the first child element

Specified by:
getFirstChild in interface Element
Returns:
The first child

getPreviousSibling

public <T extends Element> T getPreviousSibling(QName qname)
Description copied from interface: Element
Get the first previous sibling with the specified QName

Specified by:
getPreviousSibling in interface Element
Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getNextSibling

public <T extends Element> T getNextSibling(QName qname)
Description copied from interface: Element
Get the first following sibling with the specified QName

Specified by:
getNextSibling in interface Element
Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getFirstChild

public <T extends Element> T getFirstChild(QName qname)
Description copied from interface: Element
Get the first child element with the given QName

Specified by:
getFirstChild in interface Element
Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getLanguageTag

public Lang getLanguageTag()
Description copied from interface: Element
Returns the value of the xml:lang attribute as a Lang object

Specified by:
getLanguageTag in interface Element

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
Returns:
The xml:lang value

setLanguage

public <T extends Element> T setLanguage(String language)
Description copied from interface: Element
Sets the value of this elements xml:lang attribute.

Specified by:
setLanguage in interface Element
Parameters:
language - the value of the xml:lang element

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

setBaseUri

public <T extends Element> T setBaseUri(IRI base)
Description copied from interface: Element
Sets the value of this element's xml:base attribute.

Specified by:
setBaseUri in interface Element
Parameters:
base - The IRI base value

setBaseUri

public <T extends Element> T setBaseUri(String base)
Description copied from interface: Element
Sets the value of this element's xml:base attribute.

Specified by:
setBaseUri in interface Element
Parameters:
base - The Base IRI

getAttributeValue

public String getAttributeValue(QName qname)
Description copied from interface: Element
Returns the value of the named attribute

Specified by:
getAttributeValue in interface Element
Specified by:
getAttributeValue in interface org.apache.axiom.om.OMElement
Overrides:
getAttributeValue in class org.apache.axiom.om.impl.llom.OMElementImpl
Parameters:
qname - The XML QName of the attribute
Returns:
The value of the attribute

setAttributeValue

public <T extends Element> T setAttributeValue(QName qname,
                                               String value)
Description copied from interface: Element
Sets the value of the named attribute

Specified by:
setAttributeValue in interface Element
Parameters:
qname - The XML QName of the attribute
value - The value of the attribute

_getChildrenAsSet

protected <E extends Element> List<E> _getChildrenAsSet(QName qname)

_setChild

protected void _setChild(QName qname,
                         org.apache.axiom.om.OMElement element)

_getUriValue

protected IRI _getUriValue(String v)

_getStringValue

protected String _getStringValue(IRI uri)

_resolve

protected IRI _resolve(IRI base,
                       IRI value)

writeTo

public void writeTo(OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream

Specified by:
writeTo in interface Base
Parameters:
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer

Specified by:
writeTo in interface Base
Parameters:
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    Writer out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream

Specified by:
writeTo in interface Base
Parameters:
out - The java.io.OutputStream to use when serializing the Base. The charset encoding specified for the document will be used
Throws:
IOException

writeTo

public void writeTo(Writer writer)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified writer

Specified by:
writeTo in interface Base
Parameters:
writer - The java.io.Writer to use when serializing the Base
Throws:
IOException

getDocument

public <T extends Element> Document<T> getDocument()
Description copied from interface: Element
Returns the document to which this element belongs

Specified by:
getDocument in interface Element
Returns:
The Document to which this element belongs

getAttributeValue

public String getAttributeValue(String name)
Description copied from interface: Element
Returns the value of the named attribute

Specified by:
getAttributeValue in interface Element
Parameters:
name - The name of the attribute
Returns:
The value of the attribute

setAttributeValue

public <T extends Element> T setAttributeValue(String name,
                                               String value)
Description copied from interface: Element
Sets the value of the named attribute

Specified by:
setAttributeValue in interface Element
Parameters:
name - The name of the attribute
value - The value of the attribute

_setElementValue

protected void _setElementValue(QName qname,
                                String value)

_getElementValue

protected String _getElementValue(QName qname)

getTextElement

protected <T extends Text> T getTextElement(QName qname)

setTextElement

protected <T extends Text> void setTextElement(QName qname,
                                               T text,
                                               boolean many)

setTextText

protected Text setTextText(QName qname,
                           String value)

setHtmlText

protected Text setHtmlText(QName qname,
                           String value,
                           IRI baseUri)

setXhtmlText

protected Text setXhtmlText(QName qname,
                            String value,
                            IRI baseUri)

setXhtmlText

protected Text setXhtmlText(QName qname,
                            Div value,
                            IRI baseUri)

setText

public void setText(String text)
Description copied from interface: Element
Set the Text value of this element

Specified by:
setText in interface Element
Specified by:
setText in interface org.apache.axiom.om.OMElement
Overrides:
setText in class org.apache.axiom.om.impl.llom.OMElementImpl
Parameters:
text - The text value

getText

public String getText()
Description copied from interface: Element
Returns the Text value of this element

Specified by:
getText in interface Element
Specified by:
getText in interface org.apache.axiom.om.OMElement
Overrides:
getText in class org.apache.axiom.om.impl.llom.OMElementImpl
Returns:
The text value

getText

protected String getText(QName qname)

getAttributes

public List<QName> getAttributes()
Description copied from interface: Element
Returns a listing of all attributes on this element

Specified by:
getAttributes in interface Element
Returns:
The listing of attributes for this element

getExtensionAttributes

public List<QName> getExtensionAttributes()
Description copied from interface: Element
Returns a listing of extension attributes on this element (extension attributes are attributes whose namespace URI is different than the elements)

Specified by:
getExtensionAttributes in interface Element
Returns:
The listing non-Atom attributes

_parse

protected Element _parse(String value,
                         IRI baseUri)
                  throws ParseException,
                         UnsupportedEncodingException
Throws:
ParseException
UnsupportedEncodingException

removeAttribute

public <T extends Element> T removeAttribute(QName qname)
Description copied from interface: Element
Remove the named Attribute

Specified by:
removeAttribute in interface Element
Parameters:
qname - The XML QName of the attribute to remove

removeAttribute

public <T extends Element> T removeAttribute(String name)
Description copied from interface: Element
Remove the named attribute

Specified by:
removeAttribute in interface Element
Parameters:
name - The name of the attribute to remove

_removeChildren

protected void _removeChildren(QName qname,
                               boolean many)

_removeAllChildren

protected void _removeAllChildren()

clone

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

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

_copyElement

protected org.apache.axiom.om.OMElement _copyElement(org.apache.axiom.om.OMElement src,
                                                     org.apache.axiom.om.OMElement dest)

_create

protected org.apache.axiom.om.OMElement _create(org.apache.axiom.om.OMElement src)

getFactory

public Factory getFactory()
Description copied from interface: Base
Get the Factory used to create this Base

Specified by:
getFactory in interface Base
Returns:
The Factory used to create this object

addComment

public <T extends Base> T addComment(String value)
Description copied from interface: Base
Add an XML comment to this Base

Specified by:
addComment in interface Base
Parameters:
value - The text value of the comment

getLocale

public Locale getLocale()
Description copied from interface: Element
Returns a Locale object created from the xml:lang attribute

Specified by:
getLocale in interface Element
Returns:
A Locale appropriate for the Language (xml:lang)

selectLink

protected Link selectLink(List<Link> links,
                          String type,
                          String hreflang)

declareNS

public <T extends Element> T declareNS(String uri,
                                       String prefix)
Description copied from interface: Element
Declare a namespace

Specified by:
declareNS in interface Element

isDeclared

protected boolean isDeclared(String ns,
                             String prefix)

declareIfNecessary

protected void declareIfNecessary(String ns,
                                  String prefix)

getNamespaces

public Map<String,String> getNamespaces()
Description copied from interface: Element
Return a map listing the xml namespaces declared for this element

Specified by:
getNamespaces in interface Element

getElements

public <T extends Element> List<T> getElements()
Description copied from interface: Element
Return a listing of this elements child elements

Specified by:
getElements in interface Element

getMustPreserveWhitespace

public boolean getMustPreserveWhitespace()
Description copied from interface: Element
Return true if insignificant whitespace must be preserved

Specified by:
getMustPreserveWhitespace in interface Element

setMustPreserveWhitespace

public <T extends Element> T setMustPreserveWhitespace(boolean preserve)
Description copied from interface: Element
Set to true to preserve insignificant whitespace

Specified by:
setMustPreserveWhitespace in interface Element

setText

public <T extends Element> T setText(javax.activation.DataHandler handler)
Description copied from interface: Element
Set the Text value of this element using the data handler

Specified by:
setText in interface Element

getDefaultWriterOptions

public WriterOptions getDefaultWriterOptions()
Description copied from interface: Base
Get the default WriterOptions for this object

Specified by:
getDefaultWriterOptions in interface Base

complete

public <T extends Base> T complete()
Ensure that the underlying streams are fully parsed. We might eventually need to find a more efficient way of doing this, but for now, calling toString() will ensure that this particular object is fully parsed and ready to be modified. Calling complete on an Element does not necessarily mean that the underlying stream is fully consumed, only that that particular element has been completely parsed.

Specified by:
complete in interface Base

iterator

public Iterator<Element> iterator()
Iterate over all child elements

Specified by:
iterator in interface Iterable<Element>

writeTo

public void writeTo(String writer,
                    OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
Throws:
IOException

writeTo

public void writeTo(String writer,
                    Writer out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
Throws:
IOException

writeTo

public void writeTo(String writer,
                    OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The name of the Abdera writer to use
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(String writer,
                    Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The name of the Abdera writer to use
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

toFormattedString

public String toFormattedString()


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