org.apache.woden
Interface XMLElement

All Known Implementing Classes:
BaseXMLElement, DOMXMLElement, OMXMLElement

public interface XMLElement

This interface represents an XML element information item in a format to be interpreted by the Woden implementation. It permits different representations of an element to be used as method arguments or return values without making the Woden API dependent on any particular XML parser or XML object model.

Author:
John Kaputin (jkaputin@apache.org)

Method Summary
 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.
 void setSource(java.lang.Object elem)
          Accepts an Object representing an XML element.
 

Method Detail

setSource

void setSource(java.lang.Object elem)
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.

Parameters:
elem - the Object representing the XML element
Throws:
java.lang.IllegalArgumentException - if elem is not a type supported by the implementation.

getSource

java.lang.Object getSource()
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.

Returns:
an Object representing the XML element

getAttributeValue

java.lang.String getAttributeValue(java.lang.String attrName)
Returns the value of the specified attribute or null if it is not found.

Parameters:
attrName - name of attribute to look for
Returns:
the attribute value including prefix if present

getNamespaceURI

java.net.URI getNamespaceURI()
                             throws WSDLException
Returns:
the namespace URI of the element
Throws:
WSDLException

getLocalName

java.lang.String getLocalName()
Returns:
the local name of the element

getQName

QName getQName()
Return the qualified name of this element.

Returns:
QName this element's qualified name.

getQName

QName getQName(java.lang.String prefixedValue)
               throws WSDLException
Return the qualified name from the specified prefixed value.

Parameters:
prefixedValue - of the form [namespace prefix]:[local name]
Returns:
the QName corresponding to the prefix
Throws:
WSDLException

getFirstChildElement

XMLElement getFirstChildElement()
Return the first child element of this element or null if no children are found.

Returns:
the first child element.

getNextSiblingElement

XMLElement getNextSiblingElement()
Return the next sibling element of this element or null if no siblings are found.

Returns:
the next sibling element.

getChildElements

XMLElement[] getChildElements()
Return an array of the child elements of this element or an empty array if no siblings are found.

Returns:
an XMLElement array containing the child elements.


Copyright © 2007. All Rights Reserved.