Package org.apache.abdera.model
Class ElementWrapper
- java.lang.Object
 - 
- org.apache.abdera.model.ElementWrapper
 
 
- 
- Direct Known Subclasses:
 DateTimeWrapper,ExtensibleElementWrapper,MediaAdult,MediaCategory,MediaCopyright,MediaCredit,MediaDescription,MediaHash,MediaKeywords,MediaPlayer,MediaRating,MediaRestriction,MediaText,MediaThumbnail,MediaTitle
public abstract class ElementWrapper extends java.lang.Object implements Element
Base implementation used for static extensions. 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Base>
TaddComment(java.lang.String value)Add an XML comment to this Basejava.lang.Objectclone()Clone this Base<T extends Base>
Tcomplete()Ensure that the underlying streams are fully parsed.<T extends Element>
TdeclareNS(java.lang.String uri, java.lang.String prefix)Declare a namespacevoiddiscard()Removes this element from its current documentbooleanequals(java.lang.Object other)java.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.WriterOptionsgetDefaultWriterOptions()Get the default WriterOptions for this object<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)FactorygetFactory()Get the Factory used to create this Base<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 QNameElementgetInternal()java.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 elementinthashCode()java.util.Iterator<Element>iterator()<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 handler)Set the Text value of this element using the data handlerjava.lang.StringtoString()voidwriteTo(java.io.OutputStream out)Serializes the model component out to the specified streamvoidwriteTo(java.io.OutputStream out, WriterOptions options)Serializes the model component out to the specified streamvoidwriteTo(java.io.Writer writer)Serializes the model component out to the specified writervoidwriteTo(java.io.Writer out, WriterOptions options)Serializes the model component out to the specified java.io.WritervoidwriteTo(java.lang.String writer, java.io.OutputStream out)Serializes the model component out to the specified stream using the given Abdera writervoidwriteTo(java.lang.String writer, java.io.OutputStream out, WriterOptions options)Serializes the model component out to the specified stream using the given abdera writervoidwriteTo(java.lang.String writer, java.io.Writer out)Serializes the model component out to the specified java.io.Writer using the given Abdera writervoidwriteTo(java.lang.String writer, java.io.Writer out, WriterOptions options)Serializes the model component out to the specified java.io.Writer using the given abdera writervoidwriteTo(Writer writer, java.io.OutputStream out)Serializes the model component out to the specified stream using the given Abdera writervoidwriteTo(Writer writer, java.io.OutputStream out, WriterOptions options)Serializes the model component out to the specified stream using the given abdera writervoidwriteTo(Writer writer, java.io.Writer out)Serializes the model component out to the specified java.io.Writer using the given Abdera writervoidwriteTo(Writer writer, java.io.Writer out, WriterOptions options)Serializes the model component out to the specified java.io.Writer using the given abdera writer 
 - 
 
- 
- 
Method Detail
- 
addComment
public <T extends Base> T addComment(java.lang.String value)
Description copied from interface:BaseAdd an XML comment to this Base- Specified by:
 addCommentin interfaceBase- Parameters:
 value- The text value of the comment
 
- 
clone
public java.lang.Object clone()
Description copied from interface:BaseClone this Base 
- 
declareNS
public <T extends Element> T declareNS(java.lang.String uri, java.lang.String prefix)
Description copied from interface:ElementDeclare a namespace 
- 
discard
public void discard()
Description copied from interface:ElementRemoves this element from its current document 
- 
getAttributes
public java.util.List<javax.xml.namespace.QName> getAttributes()
Description copied from interface:ElementReturns a listing of all attributes on this element- Specified by:
 getAttributesin interfaceElement- Returns:
 - The listing of attributes for this element
 
 
- 
getAttributeValue
public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
Description copied from interface:ElementReturns the value of the named attribute- Specified by:
 getAttributeValuein interfaceElement- Parameters:
 qname- The XML QName of the attribute- Returns:
 - The value of the attribute
 
 
- 
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String name)
Description copied from interface:ElementReturns the value of the named attribute- Specified by:
 getAttributeValuein interfaceElement- Parameters:
 name- The name of the attribute- Returns:
 - The value of the attribute
 
 
- 
getBaseUri
public IRI getBaseUri()
Description copied from interface:ElementReturns the value of this element'sxml:baseattribute or null ifxml:baseis undefined.- Specified by:
 getBaseUriin interfaceElement- Returns:
 - The Base URI
 
 
- 
getDocument
public <T extends Element> Document<T> getDocument()
Description copied from interface:ElementReturns the document to which this element belongs- Specified by:
 getDocumentin interfaceElement- Returns:
 - The Document to which this element belongs
 
 
- 
getExtensionAttributes
public java.util.List<javax.xml.namespace.QName> getExtensionAttributes()
Description copied from interface:ElementReturns a listing of extension attributes on this element (extension attributes are attributes whose namespace URI is different than the elements)- Specified by:
 getExtensionAttributesin interfaceElement- Returns:
 - The listing non-Atom attributes
 
 
- 
getFactory
public Factory getFactory()
Description copied from interface:BaseGet the Factory used to create this Base- Specified by:
 getFactoryin interfaceBase- Returns:
 - The Factory used to create this object
 
 
- 
getFirstChild
public <T extends Element> T getFirstChild()
Description copied from interface:ElementGet the first child element- Specified by:
 getFirstChildin interfaceElement- Returns:
 - The first child
 
 
- 
getFirstChild
public <T extends Element> T getFirstChild(javax.xml.namespace.QName qname)
Description copied from interface:ElementGet the first child element with the given QName- Specified by:
 getFirstChildin interfaceElement- Parameters:
 qname- The XML QName of the sibling to find- Returns:
 - The matching element
 
 
- 
getLanguage
public java.lang.String getLanguage()
Description copied from interface:ElementReturns the value of this elementsxml:langattribute or null ifxml:langis undefined.- Specified by:
 getLanguagein interfaceElement- Returns:
 - The xml:lang value
 
 
- 
getLanguageTag
public Lang getLanguageTag()
Description copied from interface:ElementReturns the value of the xml:lang attribute as a Lang object- Specified by:
 getLanguageTagin interfaceElement
 
- 
getLocale
public java.util.Locale getLocale()
Description copied from interface:ElementReturns a Locale object created from thexml:langattribute 
- 
getNextSibling
public <T extends Element> T getNextSibling()
Description copied from interface:ElementGet the element following this one- Specified by:
 getNextSiblingin interfaceElement- Returns:
 - The following sibling
 
 
- 
getNextSibling
public <T extends Element> T getNextSibling(javax.xml.namespace.QName qname)
Description copied from interface:ElementGet the first following sibling with the specified QName- Specified by:
 getNextSiblingin interfaceElement- Parameters:
 qname- The XML QName of the sibling to find- Returns:
 - The matching element
 
 
- 
getParentElement
public <T extends Base> T getParentElement()
Description copied from interface:ElementReturn this Element's parent element or document- Specified by:
 getParentElementin interfaceElement- Returns:
 - The parent
 
 
- 
getPreviousSibling
public <T extends Element> T getPreviousSibling()
Description copied from interface:ElementGet the element preceding this one- Specified by:
 getPreviousSiblingin interfaceElement- Returns:
 - The preceding sibling
 
 
- 
getPreviousSibling
public <T extends Element> T getPreviousSibling(javax.xml.namespace.QName qname)
Description copied from interface:ElementGet the first previous sibling with the specified QName- Specified by:
 getPreviousSiblingin interfaceElement- Parameters:
 qname- The XML QName of the sibling to find- Returns:
 - The matching element
 
 
- 
getQName
public javax.xml.namespace.QName getQName()
Description copied from interface:ElementReturn the XML QName of this element 
- 
getResolvedBaseUri
public IRI getResolvedBaseUri()
Description copied from interface:ElementReturns the current in-scope, fully qualified Base URI for this element.- Specified by:
 getResolvedBaseUriin interfaceElement
 
- 
getText
public java.lang.String getText()
Description copied from interface:ElementReturns the Text value of this element 
- 
removeAttribute
public <T extends Element> T removeAttribute(javax.xml.namespace.QName qname)
Description copied from interface:ElementRemove the named Attribute- Specified by:
 removeAttributein interfaceElement- Parameters:
 qname- The XML QName of the attribute to remove
 
- 
removeAttribute
public <T extends Element> T removeAttribute(java.lang.String name)
Description copied from interface:ElementRemove the named attribute- Specified by:
 removeAttributein interfaceElement- Parameters:
 name- The name of the attribute to remove
 
- 
setAttributeValue
public <T extends Element> T setAttributeValue(javax.xml.namespace.QName qname, java.lang.String value)
Description copied from interface:ElementSets the value of the named attribute- Specified by:
 setAttributeValuein interfaceElement- Parameters:
 qname- The XML QName of the attributevalue- The value of the attribute
 
- 
setAttributeValue
public <T extends Element> T setAttributeValue(java.lang.String name, java.lang.String value)
Description copied from interface:ElementSets the value of the named attribute- Specified by:
 setAttributeValuein interfaceElement- Parameters:
 name- The name of the attributevalue- The value of the attribute
 
- 
setBaseUri
public <T extends Element> T setBaseUri(IRI base)
Description copied from interface:ElementSets the value of this element'sxml:baseattribute.- Specified by:
 setBaseUriin interfaceElement- Parameters:
 base- The IRI base value
 
- 
setBaseUri
public <T extends Element> T setBaseUri(java.lang.String base)
Description copied from interface:ElementSets the value of this element'sxml:baseattribute.- Specified by:
 setBaseUriin interfaceElement- Parameters:
 base- The Base IRI
 
- 
setLanguage
public <T extends Element> T setLanguage(java.lang.String language)
Description copied from interface:ElementSets the value of this elementsxml:langattribute.- Specified by:
 setLanguagein interfaceElement- Parameters:
 language- the value of the xml:lang element
 
- 
setParentElement
public <T extends Element> T setParentElement(Element parent)
Description copied from interface:ElementSet this Element's parent element- Specified by:
 setParentElementin interfaceElement- Parameters:
 parent- The parent element
 
- 
setText
public void setText(java.lang.String text)
Description copied from interface:ElementSet the Text value of this element 
- 
setText
public <T extends Element> T setText(javax.activation.DataHandler handler)
Description copied from interface:ElementSet the Text value of this element using the data handler 
- 
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified stream 
- 
writeTo
public void writeTo(java.io.Writer writer) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified writer 
- 
equals
public boolean equals(java.lang.Object other)
- Overrides:
 equalsin classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
getInternal
public Element getInternal()
 
- 
getElements
public <T extends Element> java.util.List<T> getElements()
Description copied from interface:ElementReturn a listing of this elements child elements- Specified by:
 getElementsin interfaceElement
 
- 
getNamespaces
public java.util.Map<java.lang.String,java.lang.String> getNamespaces()
Description copied from interface:ElementReturn a map listing the xml namespaces declared for this element- Specified by:
 getNamespacesin interfaceElement
 
- 
getMustPreserveWhitespace
public boolean getMustPreserveWhitespace()
Description copied from interface:ElementReturn true if insignificant whitespace must be preserved- Specified by:
 getMustPreserveWhitespacein interfaceElement
 
- 
setMustPreserveWhitespace
public <T extends Element> T setMustPreserveWhitespace(boolean preserve)
Description copied from interface:ElementSet to true to preserve insignificant whitespace- Specified by:
 setMustPreserveWhitespacein interfaceElement
 
- 
writeTo
public void writeTo(java.io.OutputStream out, WriterOptions options) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified stream 
- 
writeTo
public void writeTo(Writer writer, java.io.OutputStream out, WriterOptions options) throws java.io.IOException
Description copied from interface:BaseSerializes the model component out to the specified stream using the given abdera writer 
- 
writeTo
public void writeTo(Writer writer, java.io.OutputStream out) throws java.io.IOException
Description copied from interface:BaseSerializes the model component out to the specified stream using the given Abdera writer 
- 
writeTo
public void writeTo(Writer writer, java.io.Writer out, WriterOptions options) throws java.io.IOException
Description copied from interface:BaseSerializes the model component out to the specified java.io.Writer using the given abdera writer 
- 
writeTo
public void writeTo(Writer writer, java.io.Writer out) throws java.io.IOException
Description copied from interface:BaseSerializes the model component out to the specified java.io.Writer using the given Abdera writer 
- 
writeTo
public void writeTo(java.lang.String writer, java.io.OutputStream out, WriterOptions options) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified stream using the given abdera writer 
- 
writeTo
public void writeTo(java.lang.String writer, java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified stream using the given Abdera writer 
- 
writeTo
public void writeTo(java.lang.String writer, java.io.Writer out, WriterOptions options) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified java.io.Writer using the given abdera writer 
- 
writeTo
public void writeTo(java.lang.String writer, java.io.Writer out) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified java.io.Writer using the given Abdera writer 
- 
writeTo
public void writeTo(java.io.Writer out, WriterOptions options) throws java.io.IOExceptionDescription copied from interface:BaseSerializes the model component out to the specified java.io.Writer 
- 
getDefaultWriterOptions
public WriterOptions getDefaultWriterOptions()
Description copied from interface:BaseGet the default WriterOptions for this object- Specified by:
 getDefaultWriterOptionsin interfaceBase
 
- 
complete
public <T extends Base> T complete()
Description copied from interface:BaseEnsure that the underlying streams are fully parsed. 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. 
 - 
 
 -