org.apache.abdera.model
Interface Element

All Superinterfaces:
Base, java.lang.Cloneable
All Known Subinterfaces:
Categories, Category, Collection, Content, Control, DateTime, Div, Entry, ExtensibleElement, Feed, Generator, IRIElement, Link, Person, Service, Source, Text, Workspace
All Known Implementing Classes:
DateTimeWrapper, ElementWrapper, Error, ExtensibleElementWrapper, PersonWrapper

public interface Element
extends Base

Root interface for all elements in the Feed Object Model


Method Summary
 void declareNS(java.lang.String uri, java.lang.String prefix)
          Declare a namespace
 void discard()
          Removes this element from its current document
 java.util.List<javax.xml.namespace.QName> getAttributes()
          Returns a listing of all attributes on this element
 java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
          Returns the value of the named attribute
 java.lang.String getAttributeValue(java.lang.String name)
          Returns the value of the named attribute
 org.apache.abdera.i18n.iri.IRI getBaseUri()
          Returns the value of this element's xml:base attribute or null if xml:base is undefined.
<T extends Element>
Document<T>
getDocument()
          Returns the document to which this element belongs
<T extends Element>
java.util.List<T>
getElements()
           
 java.util.List<javax.xml.namespace.QName> getExtensionAttributes()
          Returns a listing of extension attributes on this element (extension attributes are attributes whose namespace URI is different than the elements)
<T extends Element>
T
getFirstChild()
          Get the first child element
<T extends Element>
T
getFirstChild(javax.xml.namespace.QName qname)
          Get the first child element with the given QName
 java.lang.String getLanguage()
          Returns the value of this elements xml:lang attribute or null if xml:lang is undefined.
 org.apache.abdera.i18n.lang.Lang getLanguageTag()
          Returns the value of the xml:lang attribute as a Lang object
 java.util.Locale getLocale()
          Returns a Locale object created from the xml:lang attribute
 boolean getMustPreserveWhitespace()
           
 java.util.Map<java.lang.String,java.lang.String> getNamespaces()
           
<T extends Element>
T
getNextSibling()
          Get the element following this one
<T extends Element>
T
getNextSibling(javax.xml.namespace.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(javax.xml.namespace.QName qname)
          Get the first previous sibling with the specified QName
 javax.xml.namespace.QName getQName()
          Return the XML QName of this element
 org.apache.abdera.i18n.iri.IRI getResolvedBaseUri()
          Returns the current in-scope, fully qualified Base URI for this element.
 java.lang.String getText()
          Returns the Text value of this element
 void removeAttribute(javax.xml.namespace.QName qname)
          Remove the named Attribute
 void setAttributeValue(javax.xml.namespace.QName qname, java.lang.String value)
          Sets the value of the named attribute
 void setAttributeValue(java.lang.String name, java.lang.String value)
          Sets the value of the named attribute
 void setBaseUri(org.apache.abdera.i18n.iri.IRI base)
          Sets the value of this element's xml:base attribute.
 void setBaseUri(java.lang.String base)
          Sets the value of this element's xml:base attribute.
 void setLanguage(java.lang.String language)
          Sets the value of this elements xml:lang attribute.
 void setMustPreserveWhitespace(boolean preserve)
           
 void setParentElement(Element parent)
          Set this Element's parent element
 void setText(javax.activation.DataHandler dataHandler)
          Set the Text value of this element using the data handler
 void setText(java.lang.String text)
          Set the Text value of this element
 
Methods inherited from interface org.apache.abdera.model.Base
addComment, clone, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 

Method Detail

getParentElement

<T extends Base> T getParentElement()
Return this Element's parent element or document

Returns:
The parent

setParentElement

void setParentElement(Element parent)
Set this Element's parent element

Parameters:
parent - The parent element

getPreviousSibling

<T extends Element> T getPreviousSibling()
Get the element preceding this one

Returns:
The preceding sibling

getNextSibling

<T extends Element> T getNextSibling()
Get the element following this one

Returns:
The following sibling

getFirstChild

<T extends Element> T getFirstChild()
Get the first child element

Returns:
The first child

getPreviousSibling

<T extends Element> T getPreviousSibling(javax.xml.namespace.QName qname)
Get the first previous sibling with the specified QName

Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getNextSibling

<T extends Element> T getNextSibling(javax.xml.namespace.QName qname)
Get the first following sibling with the specified QName

Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getFirstChild

<T extends Element> T getFirstChild(javax.xml.namespace.QName qname)
Get the first child element with the given QName

Parameters:
qname - The XML QName of the sibling to find
Returns:
The matching element

getQName

javax.xml.namespace.QName getQName()
Return the XML QName of this element

Returns:
The QName of the element

getLanguage

java.lang.String getLanguage()
Returns the value of this elements xml:lang attribute or null if xml:lang is undefined.

Returns:
The xml:lang value

getLanguageTag

org.apache.abdera.i18n.lang.Lang getLanguageTag()
Returns the value of the xml:lang attribute as a Lang object


getLocale

java.util.Locale getLocale()
Returns a Locale object created from the xml:lang attribute

Returns:
A Locale appropriate for the Language (xml:lang)

setLanguage

void setLanguage(java.lang.String language)
Sets the value of this elements xml:lang attribute.

Parameters:
language - the value of the xml:lang element

getBaseUri

org.apache.abdera.i18n.iri.IRI getBaseUri()
Returns the value of this element's xml:base attribute or null if xml:base is undefined.

Returns:
The Base URI
Throws:
IRISyntaxException - if the Base URI is malformed

getResolvedBaseUri

org.apache.abdera.i18n.iri.IRI getResolvedBaseUri()
Returns the current in-scope, fully qualified Base URI for this element.

Throws:
IRISyntaxException - if the Base URI is malformed

setBaseUri

void setBaseUri(org.apache.abdera.i18n.iri.IRI base)
Sets the value of this element's xml:base attribute.

Parameters:
base - The IRI base value

setBaseUri

void setBaseUri(java.lang.String base)
Sets the value of this element's xml:base attribute.

Parameters:
base - The Base IRI
Throws:
IRISyntaxException - if the base URI is malformed

getDocument

<T extends Element> Document<T> getDocument()
Returns the document to which this element belongs

Returns:
The Document to which this element belongs

getAttributeValue

java.lang.String getAttributeValue(java.lang.String name)
Returns the value of the named attribute

Parameters:
name - The name of the attribute
Returns:
The value of the attribute

getAttributeValue

java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
Returns the value of the named attribute

Parameters:
qname - The XML QName of the attribute
Returns:
The value of the attribute

getAttributes

java.util.List<javax.xml.namespace.QName> getAttributes()
Returns a listing of all attributes on this element

Returns:
The listing of attributes for this element

getExtensionAttributes

java.util.List<javax.xml.namespace.QName> getExtensionAttributes()
Returns a listing of extension attributes on this element (extension attributes are attributes whose namespace URI is different than the elements)

Returns:
The listing non-Atom attributes

removeAttribute

void removeAttribute(javax.xml.namespace.QName qname)
Remove the named Attribute

Parameters:
qname - The XML QName of the attribute to remove

setAttributeValue

void setAttributeValue(java.lang.String name,
                       java.lang.String value)
Sets the value of the named attribute

Parameters:
name - The name of the attribute
value - The value of the attribute

setAttributeValue

void setAttributeValue(javax.xml.namespace.QName qname,
                       java.lang.String value)
Sets the value of the named attribute

Parameters:
qname - The XML QName of the attribute
value - The value of the attribute

discard

void discard()
Removes this element from its current document


getText

java.lang.String getText()
Returns the Text value of this element

Returns:
The text value

setText

void setText(java.lang.String text)
Set the Text value of this element

Parameters:
text - The text value

setText

void setText(javax.activation.DataHandler dataHandler)
Set the Text value of this element using the data handler


declareNS

void declareNS(java.lang.String uri,
               java.lang.String prefix)
Declare a namespace


getNamespaces

java.util.Map<java.lang.String,java.lang.String> getNamespaces()

getElements

<T extends Element> java.util.List<T> getElements()

getMustPreserveWhitespace

boolean getMustPreserveWhitespace()

setMustPreserveWhitespace

void setMustPreserveWhitespace(boolean preserve)