org.apache.abdera.model
Class ExtensibleElementWrapper

java.lang.Object
  extended by org.apache.abdera.model.ElementWrapper
      extended by org.apache.abdera.model.ExtensibleElementWrapper
All Implemented Interfaces:
Cloneable, Iterable<Element>, Base, Element, ExtensibleElement
Direct Known Subclasses:
Bar, Error, PersonWrapper

public abstract class ExtensibleElementWrapper
extends ElementWrapper
implements ExtensibleElement

ElementWrapper implementation that implements the ExtensibleElement interface. This should be used to create static extension elements that support extensions


Constructor Summary
protected ExtensibleElementWrapper(Element internal)
           
  ExtensibleElementWrapper(Factory factory, QName qname)
           
 
Method Summary
<T extends ExtensibleElement>
T
addExtension(Element extension)
          Adds an individual extension element
<T extends ExtensibleElement>
T
addExtension(Element extension, Element before)
          Adds an individual extension element before the specified element
<T extends Element>
T
addExtension(QName qname)
          Adds an individual extension element
<T extends Element>
T
addExtension(QName qname, QName before)
          Adds an individual extension element
<T extends Element>
T
addExtension(String namespace, String localPart, String prefix)
          Adds an individual extension element
 Element addSimpleExtension(QName qname, String value)
          Adds a simple extension (text content only)
 Element addSimpleExtension(String namespace, String localPart, String prefix, String value)
          Adds a simple extension (text content only)
<T extends Element>
T
getExtension(Class<T> _class)
          Find an extension by Class rather than QName
<T extends Element>
T
getExtension(QName qname)
          Returns the first extension element with the XML qualified name
 List<Element> getExtensions()
          Returns the complete set of extension elements
<T extends Element>
List<T>
getExtensions(QName qname)
          Returns the complete set of extension elements using the specified XML qualified name
 List<Element> getExtensions(String uri)
          Returns the complete set of extension elements using the specified XML Namespace URI
protected  ExtensibleElement getExtInternal()
           
 boolean getMustPreserveWhitespace()
          Return true if insignificant whitespace must be preserved
 String getSimpleExtension(QName qname)
          Gets the value of a simple extension
 String getSimpleExtension(String namespace, String localPart, String prefix)
          Gets the value of a simple extension
<T extends Element>
T
setMustPreserveWhitespace(boolean preserve)
          Set to true to preserve insignificant whitespace
 
Methods inherited from class org.apache.abdera.model.ElementWrapper
addComment, clone, complete, declareNS, discard, equals, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDefaultWriterOptions, getDocument, getElements, getExtensionAttributes, getFactory, getFirstChild, getFirstChild, getInternal, getLanguage, getLanguageTag, getLocale, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, hashCode, iterator, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setParentElement, setText, setText, toString, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.model.Element
declareNS, discard, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDocument, getElements, getExtensionAttributes, getFirstChild, getFirstChild, getLanguage, getLanguageTag, getLocale, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setParentElement, setText, setText
 
Methods inherited from interface org.apache.abdera.model.Base
addComment, clone, complete, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

ExtensibleElementWrapper

protected ExtensibleElementWrapper(Element internal)

ExtensibleElementWrapper

public ExtensibleElementWrapper(Factory factory,
                                QName qname)
Method Detail

getExtInternal

protected ExtensibleElement getExtInternal()

addExtension

public <T extends ExtensibleElement> T addExtension(Element extension)
Description copied from interface: ExtensibleElement
Adds an individual extension element

Specified by:
addExtension in interface ExtensibleElement
Parameters:
extension - An extension element to add

addExtension

public <T extends Element> T addExtension(QName qname)
Description copied from interface: ExtensibleElement
Adds an individual extension element

Specified by:
addExtension in interface ExtensibleElement
Parameters:
qname - An extension element to create
Returns:
The newly created extension element

addExtension

public <T extends Element> T addExtension(String namespace,
                                          String localPart,
                                          String prefix)
Description copied from interface: ExtensibleElement
Adds an individual extension element

Specified by:
addExtension in interface ExtensibleElement
Parameters:
namespace - An XML namespace
localPart - A localname
prefix - A XML namespace prefix
Returns:
The newly creatd extension element

addSimpleExtension

public Element addSimpleExtension(QName qname,
                                  String value)
Description copied from interface: ExtensibleElement
Adds a simple extension (text content only)

Specified by:
addSimpleExtension in interface ExtensibleElement
Parameters:
qname - An XML QName
value - The simple text value of the element
Returns:
The newly created extension element

addSimpleExtension

public Element addSimpleExtension(String namespace,
                                  String localPart,
                                  String prefix,
                                  String value)
Description copied from interface: ExtensibleElement
Adds a simple extension (text content only)

Specified by:
addSimpleExtension in interface ExtensibleElement
Parameters:
namespace - An XML namespace
localPart - A local name
prefix - A namespace prefix
value - The simple text value
Returns:
The newly created extension element

getExtension

public <T extends Element> T getExtension(QName qname)
Description copied from interface: ExtensibleElement
Returns the first extension element with the XML qualified name

Specified by:
getExtension in interface ExtensibleElement
Parameters:
qname - An XML QName
Returns:
An extension with the specified qname

getExtension

public <T extends Element> T getExtension(Class<T> _class)
Description copied from interface: ExtensibleElement
Find an extension by Class rather than QName

Specified by:
getExtension in interface ExtensibleElement
Parameters:
_class - The implementation class of the extension
Returns:
The extension element

getExtensions

public List<Element> getExtensions()
Description copied from interface: ExtensibleElement
Returns the complete set of extension elements

Specified by:
getExtensions in interface ExtensibleElement
Returns:
a listing of extensions

getExtensions

public List<Element> getExtensions(String uri)
Description copied from interface: ExtensibleElement
Returns the complete set of extension elements using the specified XML Namespace URI

Specified by:
getExtensions in interface ExtensibleElement
Parameters:
uri - A namespace URI
Returns:
A listing of extensions using the specified XML namespace

getExtensions

public <T extends Element> List<T> getExtensions(QName qname)
Description copied from interface: ExtensibleElement
Returns the complete set of extension elements using the specified XML qualified name

Specified by:
getExtensions in interface ExtensibleElement
Parameters:
qname - An XML QName
Returns:
A listing of extensions with the specified QName

getSimpleExtension

public String getSimpleExtension(QName qname)
Description copied from interface: ExtensibleElement
Gets the value of a simple extension

Specified by:
getSimpleExtension in interface ExtensibleElement
Parameters:
qname - An XML QName
Returns:
The string value of the extension

getSimpleExtension

public String getSimpleExtension(String namespace,
                                 String localPart,
                                 String prefix)
Description copied from interface: ExtensibleElement
Gets the value of a simple extension

Specified by:
getSimpleExtension in interface ExtensibleElement
Parameters:
namespace - An XML namespace
localPart - A localname
prefix - A namespace prefix
Returns:
The string value of the extension

getMustPreserveWhitespace

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

Specified by:
getMustPreserveWhitespace in interface Element
Overrides:
getMustPreserveWhitespace in class ElementWrapper

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
Overrides:
setMustPreserveWhitespace in class ElementWrapper

addExtension

public <T extends ExtensibleElement> T addExtension(Element extension,
                                                    Element before)
Description copied from interface: ExtensibleElement
Adds an individual extension element before the specified element

Specified by:
addExtension in interface ExtensibleElement

addExtension

public <T extends Element> T addExtension(QName qname,
                                          QName before)
Description copied from interface: ExtensibleElement
Adds an individual extension element

Specified by:
addExtension in interface ExtensibleElement
Parameters:
qname - An extension element to create
Returns:
The newly created extension element


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