Package org.apache.abdera.model
Interface Element
-
- 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,ExtensibleElementWrapper,MediaAdult,MediaCategory,MediaContent,MediaCopyright,MediaCredit,MediaDescription,MediaGroup,MediaHash,MediaKeywords,MediaPlayer,MediaRating,MediaRestriction,MediaText,MediaThumbnail,MediaTitle,PersonWrapper
public interface Element extends Base, java.lang.Iterable<Element>
Root interface for all elements in the Feed Object Model
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Element>
TdeclareNS(java.lang.String uri, java.lang.String prefix)Declare a namespacevoiddiscard()Removes this element from its current documentjava.util.List<javax.xml.namespace.QName>getAttributes()Returns a listing of all attributes on this elementjava.lang.StringgetAttributeValue(java.lang.String name)Returns the value of the named attributejava.lang.StringgetAttributeValue(javax.xml.namespace.QName qname)Returns the value of the named attributeIRIgetBaseUri()Returns the value of this element'sxml:baseattribute or null ifxml:baseis undefined.<T extends Element>
Document<T>getDocument()Returns the document to which this element belongs<T extends Element>
java.util.List<T>getElements()Return a listing of this elements child elementsjava.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>
TgetFirstChild()Get the first child element<T extends Element>
TgetFirstChild(javax.xml.namespace.QName qname)Get the first child element with the given QNamejava.lang.StringgetLanguage()Returns the value of this elementsxml:langattribute or null ifxml:langis undefined.LanggetLanguageTag()Returns the value of the xml:lang attribute as a Lang objectjava.util.LocalegetLocale()Returns a Locale object created from thexml:langattributebooleangetMustPreserveWhitespace()Return true if insignificant whitespace must be preservedjava.util.Map<java.lang.String,java.lang.String>getNamespaces()Return a map listing the xml namespaces declared for this element<T extends Element>
TgetNextSibling()Get the element following this one<T extends Element>
TgetNextSibling(javax.xml.namespace.QName qname)Get the first following sibling with the specified QName<T extends Base>
TgetParentElement()Return this Element's parent element or document<T extends Element>
TgetPreviousSibling()Get the element preceding this one<T extends Element>
TgetPreviousSibling(javax.xml.namespace.QName qname)Get the first previous sibling with the specified QNamejavax.xml.namespace.QNamegetQName()Return the XML QName of this elementIRIgetResolvedBaseUri()Returns the current in-scope, fully qualified Base URI for this element.java.lang.StringgetText()Returns the Text value of this element<T extends Element>
TremoveAttribute(java.lang.String name)Remove the named attribute<T extends Element>
TremoveAttribute(javax.xml.namespace.QName qname)Remove the named Attribute<T extends Element>
TsetAttributeValue(java.lang.String name, java.lang.String value)Sets the value of the named attribute<T extends Element>
TsetAttributeValue(javax.xml.namespace.QName qname, java.lang.String value)Sets the value of the named attribute<T extends Element>
TsetBaseUri(java.lang.String base)Sets the value of this element'sxml:baseattribute.<T extends Element>
TsetBaseUri(IRI base)Sets the value of this element'sxml:baseattribute.<T extends Element>
TsetLanguage(java.lang.String language)Sets the value of this elementsxml:langattribute.<T extends Element>
TsetMustPreserveWhitespace(boolean preserve)Set to true to preserve insignificant whitespace<T extends Element>
TsetParentElement(Element parent)Set this Element's parent elementvoidsetText(java.lang.String text)Set the Text value of this element<T extends Element>
TsetText(javax.activation.DataHandler dataHandler)Set the Text value of this element using the data handler
-
-
-
Method Detail
-
getParentElement
<T extends Base> T getParentElement()
Return this Element's parent element or document- Returns:
- The parent
-
setParentElement
<T extends Element> T 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 elementsxml:langattribute or null ifxml:langis undefined.- Returns:
- The xml:lang value
-
getLanguageTag
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 thexml:langattribute- Returns:
- A Locale appropriate for the Language (xml:lang)
-
setLanguage
<T extends Element> T setLanguage(java.lang.String language)
Sets the value of this elementsxml:langattribute.- Parameters:
language- the value of the xml:lang element
-
getBaseUri
IRI getBaseUri()
Returns the value of this element'sxml:baseattribute or null ifxml:baseis undefined.- Returns:
- The Base URI
- Throws:
IRISyntaxException- if the Base URI is malformed
-
getResolvedBaseUri
IRI getResolvedBaseUri()
Returns the current in-scope, fully qualified Base URI for this element.- Throws:
IRISyntaxException- if the Base URI is malformed
-
setBaseUri
<T extends Element> T setBaseUri(IRI base)
Sets the value of this element'sxml:baseattribute.- Parameters:
base- The IRI base value
-
setBaseUri
<T extends Element> T setBaseUri(java.lang.String base)
Sets the value of this element'sxml:baseattribute.- 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
<T extends Element> T removeAttribute(javax.xml.namespace.QName qname)
Remove the named Attribute- Parameters:
qname- The XML QName of the attribute to remove
-
removeAttribute
<T extends Element> T removeAttribute(java.lang.String name)
Remove the named attribute- Parameters:
name- The name of the attribute to remove
-
setAttributeValue
<T extends Element> T setAttributeValue(java.lang.String name, java.lang.String value)
Sets the value of the named attribute- Parameters:
name- The name of the attributevalue- The value of the attribute
-
setAttributeValue
<T extends Element> T setAttributeValue(javax.xml.namespace.QName qname, java.lang.String value)
Sets the value of the named attribute- Parameters:
qname- The XML QName of the attributevalue- 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
<T extends Element> T setText(javax.activation.DataHandler dataHandler)
Set the Text value of this element using the data handler
-
declareNS
<T extends Element> T declareNS(java.lang.String uri, java.lang.String prefix)
Declare a namespace
-
getNamespaces
java.util.Map<java.lang.String,java.lang.String> getNamespaces()
Return a map listing the xml namespaces declared for this element
-
getElements
<T extends Element> java.util.List<T> getElements()
Return a listing of this elements child elements
-
getMustPreserveWhitespace
boolean getMustPreserveWhitespace()
Return true if insignificant whitespace must be preserved
-
setMustPreserveWhitespace
<T extends Element> T setMustPreserveWhitespace(boolean preserve)
Set to true to preserve insignificant whitespace
-
-