org.apache.woden.internal
Class BaseXMLElement

java.lang.Object
  extended by org.apache.woden.internal.BaseXMLElement
All Implemented Interfaces:
XMLElement
Direct Known Subclasses:
DOMXMLElement, OMXMLElement

public abstract class BaseXMLElement
extends java.lang.Object
implements XMLElement

This abstract class implements methods of the XMLElement interface that are common across all concrete implementations.


Field Summary
protected  ErrorReporter fErrorReporter
           
protected  java.lang.Object fSource
           
 
Constructor Summary
protected BaseXMLElement(ErrorReporter errorReporter)
           
 
Method Summary
protected abstract  java.lang.String doGetAttributeValue(java.lang.String attrName)
           
protected abstract  XMLElement[] doGetChildElements()
           
protected abstract  XMLElement doGetFirstChildElement()
           
protected abstract  java.lang.String doGetLocalName()
           
protected abstract  java.net.URI doGetNamespaceURI()
           
protected abstract  XMLElement doGetNextSiblingElement()
           
protected abstract  QName doGetQName()
           
protected abstract  QName doGetQName(java.lang.String prefixedValue)
           
 java.lang.String getAttributeValue(java.lang.String attrName)
          Returns the value of the specified attribute or null if it is not found.
 XMLElement[] getChildElements()
          Return an array of the child elements of this element or an empty array if no siblings are found.
 XMLElement getFirstChildElement()
          Return the first child element of this element or null if no children are found.
 java.lang.String getLocalName()
           
 java.net.URI getNamespaceURI()
           
 XMLElement getNextSiblingElement()
          Return the next sibling element of this element or null if no siblings are found.
 QName getQName()
          Return the qualified name of this element.
 QName getQName(java.lang.String prefixedValue)
          Return the qualified name from the specified prefixed value.
 java.lang.Object getSource()
          Returns an Object representing an XML element, which the caller must cast to the expected type.
abstract  void setSource(java.lang.Object elem)
          Accepts an Object representing an XML element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fSource

protected java.lang.Object fSource

fErrorReporter

protected ErrorReporter fErrorReporter
Constructor Detail

BaseXMLElement

protected BaseXMLElement(ErrorReporter errorReporter)
Method Detail

setSource

public abstract void setSource(java.lang.Object elem)
Description copied from interface: XMLElement
Accepts an Object representing an XML element. The implementation should check that it is of a type appropriate for the underlying XML parser or XML Object model being used. For example, a DOM implementation might expect an org.w3c.dom.Element while an AXIOM implementation might expect org.apache.axiom.om.OMElement.

Specified by:
setSource in interface XMLElement
Parameters:
elem - the Object representing the XML element

getSource

public final java.lang.Object getSource()
Description copied from interface: XMLElement
Returns an Object representing an XML element, which the caller must cast to the expected type. For example, for DOM implementation we might cast it to an org.w3c.dom.Element whereas an AXIOM implementation might cast it to an org.apache.axiom.om.OMElement.

Specified by:
getSource in interface XMLElement
Returns:
an Object representing the XML element

getAttributeValue

public final java.lang.String getAttributeValue(java.lang.String attrName)
Description copied from interface: XMLElement
Returns the value of the specified attribute or null if it is not found.

Specified by:
getAttributeValue in interface XMLElement
Parameters:
attrName - name of attribute to look for
Returns:
the attribute value including prefix if present

doGetAttributeValue

protected abstract java.lang.String doGetAttributeValue(java.lang.String attrName)

getNamespaceURI

public final java.net.URI getNamespaceURI()
                                   throws WSDLException
Specified by:
getNamespaceURI in interface XMLElement
Returns:
the namespace URI of the element
Throws:
WSDLException

doGetNamespaceURI

protected abstract java.net.URI doGetNamespaceURI()
                                           throws WSDLException
Throws:
WSDLException

getLocalName

public final java.lang.String getLocalName()
Specified by:
getLocalName in interface XMLElement
Returns:
the local name of the element

doGetLocalName

protected abstract java.lang.String doGetLocalName()

getQName

public final QName getQName()
Description copied from interface: XMLElement
Return the qualified name of this element.

Specified by:
getQName in interface XMLElement
Returns:
QName this element's qualified name.

doGetQName

protected abstract QName doGetQName()

getQName

public final QName getQName(java.lang.String prefixedValue)
                     throws WSDLException
Description copied from interface: XMLElement
Return the qualified name from the specified prefixed value.

Specified by:
getQName in interface XMLElement
Parameters:
prefixedValue - of the form [namespace prefix]:[local name]
Returns:
the QName corresponding to the prefix
Throws:
WSDLException

doGetQName

protected abstract QName doGetQName(java.lang.String prefixedValue)
                             throws WSDLException
Throws:
WSDLException

getFirstChildElement

public final XMLElement getFirstChildElement()
Description copied from interface: XMLElement
Return the first child element of this element or null if no children are found.

Specified by:
getFirstChildElement in interface XMLElement
Returns:
the first child element.

doGetFirstChildElement

protected abstract XMLElement doGetFirstChildElement()

getNextSiblingElement

public final XMLElement getNextSiblingElement()
Description copied from interface: XMLElement
Return the next sibling element of this element or null if no siblings are found.

Specified by:
getNextSiblingElement in interface XMLElement
Returns:
the next sibling element.

doGetNextSiblingElement

protected abstract XMLElement doGetNextSiblingElement()

getChildElements

public final XMLElement[] getChildElements()
Description copied from interface: XMLElement
Return an array of the child elements of this element or an empty array if no siblings are found.

Specified by:
getChildElements in interface XMLElement
Returns:
an XMLElement array containing the child elements.

doGetChildElements

protected abstract XMLElement[] doGetChildElements()


Copyright © 2007. All Rights Reserved.