org.apache.axis.message

Class MessageElement

public class MessageElement extends NodeImpl implements SOAPElement, Serializable, NodeList, Cloneable

MessageElement is the base type of nodes of the SOAP message parse tree. Note: it was made Serializable to help users of Apache SOAP who had exploited the serializability of the DOM tree to migrate to Axis.

UNKNOWN: implement the NodeList methods properly, with tests.

Nested Class Summary
protected static classMessageElement.QNameAttr
class that represents a qname in a the qNameAttrs vector.
Field Summary
protected DeserializationContextcontext
protected StringencodingStyle
Our encoding style, if any
protected intendEventIndex
protected DeserializerfixupDeserializer
!
protected Stringhref
protected Stringid
protected static Loglog
protected SOAPEnvelopemessage
ArrayListnamespaces
protected VectorqNameAttrs
protected SAX2EventRecorderrecorder
protected intstartContentsIndex
protected intstartEventIndex
protected QNametypeQName
protected boolean_isRoot
Constructor Summary
MessageElement()
No-arg constructor for building messages?
MessageElement(String namespace, String localPart)
constructor
MessageElement(String localPart, String prefix, String namespace)
constructor.
MessageElement(Name eltName)
construct using a Name implementation,
MessageElement(String namespace, String localPart, Object value)
constructor binding the internal object value field to the value parameter
MessageElement(QName name)
constructor declaring the qualified name of the node
MessageElement(QName name, Object value)
constructor declaring the qualified name of the node and its value
MessageElement(Element elem)
create a node through a deep copy of the passed in element.
MessageElement(CharacterData text)
construct a text element.
MessageElement(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context)
Advanced constructor used for deserialization.
Method Summary
voidaddAttribute(String namespace, String localName, QName value)
add an attribute to the qname vector.
voidaddAttribute(String namespace, String localName, String value)
add a normal CDATA/text attribute.
voidaddAttribute(String attrPrefix, String namespace, String localName, String value)
add an attribute.
SOAPElementaddAttribute(Name attrName, String value)
add a new attribute
voidaddChild(MessageElement el)
Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.
SOAPElementaddChildElement(Name childName)
add the child element
SOAPElementaddChildElement(String localName)
add a child element in the message element's own namespace
SOAPElementaddChildElement(String localName, String prefixName)
add a child element
SOAPElementaddChildElement(String localName, String childPrefix, String uri)
add a child element
SOAPElementaddChildElement(SOAPElement element)
The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.
voidaddMapping(Mapping map)
add a new namespace/prefix mapping
SOAPElementaddNamespaceDeclaration(String prefix, String uri)
create a Mapping mapping and add to our namespace list.
SOAPElementaddTextNode(String s)
add a text node to the document.
protected voidchildDeepCloned(NodeImpl oldNode, NodeImpl newNode)
NodecloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
protected Objectcloning()
protected clone method (not public) copied status ------------------- protected String name ; Y protected String prefix ; Y protected String namespaceURI ; Y protected transient Attributes attributes Y protected String id; Y?
voiddetachAllChildren()
remove all children.
booleanequals(Object obj)
equality test.
protected MessageElementfindElement(Vector vec, String namespace, String localPart)
IteratorgetAllAttributes()
Get an interator to all the attributes of the node.
DocumentgetAsDocument()
get the message element as a document.
ElementgetAsDOM()
create a DOM from the message element, by serializing and deserializing the element
StringgetAsString()
get the message element as a string.
StringgetAttribute(String attrName)
get an attribute by name
AttrgetAttributeNode(String attrName)
This unimplemented operation is meand to return an attribute as a node
AttrgetAttributeNodeNS(String namespace, String localName)
StringgetAttributeNS(String namespaceURI, String localName)
get the attribute with namespace/local name match.
AttributesgetAttributesEx()
get the attributes
StringgetAttributeValue(String localName)
get the value of an attribute
StringgetAttributeValue(Name attrName)
Get the value of an attribute whose namespace and local name are described.
MessageElementgetChildElement(QName qname)
Convenience method to get the first matching child for a given QName.
IteratorgetChildElements()
get an iterator over the children This iterator may get confused if changes are made to the children while the iteration is in progress.
IteratorgetChildElements(QName qname)
get an iterator over child elements
IteratorgetChildElements(Name childName)
get an iterator over child elements
ListgetChildren()
get a list of children
AttributesgetCompleteAttributes()
Obtain an Attributes collection consisting of all attributes for this MessageElement, including namespace declarations.
DeserializationContextgetDeserializationContext()
Retrieve the DeserializationContext associated with this MessageElement
NamegetElementName()
get the full name of the element
NodeListgetElementsByTagName(String tagName)
NodeListgetElementsByTagNameNS(String namespace, String localName)
protected NodeListgetElementsNS(Element parentElement, String namespace, String localName)
helper method for recusively getting the element that has namespace URI and localname
StringgetEncodingStyle()
Get the encoding style.
SOAPEnvelopegetEnvelope()
get our current envelope
DeserializergetFixupDeserializer()
StringgetHref()
get a saved href
StringgetID()
get a saved ID
intgetLength()
The number of nodes in the list.
StringgetName()
get the local name of this element
IteratorgetNamespacePrefixes()
get an iterator of the prefixes.
StringgetNamespaceURI(String searchPrefix)
map from a prefix to a namespace.
ObjectgetObjectValue()
Returns value of the node as an object of registered type.
ObjectgetObjectValue(Class cls)
Returns value of the node as an object of registered type.
DocumentgetOwnerDocument()
StringgetPrefix(String searchNamespaceURI)
get the prefix for a given namespace URI
QNamegetQName()
get the fully qualified name of this element
MessageElementgetRealElement()
get the 'real' element -will follow hrefs.
SAX2EventRecordergetRecorder()
get the event recorder
StringgetTagName()
QNamegetType()
get the element's type.
StringgetValue()
Get the value of the doc as a string.
ObjectgetValueAsType(QName type)
ObjectgetValueAsType(QName type, Class cls)
This is deserialization logic mixed in to our element class.
protected StringgetValueDOM()
IteratorgetVisibleNamespacePrefixes()
get an iterator over visible prefixes.
booleanhasAttribute(String attrName)
test for an attribute existing
booleanhasAttributeNS(String namespace, String localName)
Test for an attribute
booleanisRoot()
get the is-root flag
Nodeitem(int index)
get a child node
voidoutput(SerializationContext outputContext)
This is the public output() method, which will always simply use the recorded SAX stream for this element if it is available.
protected voidoutputImpl(SerializationContext outputContext)
override point -output to a serialization context.
voidpublishContents(ContentHandler handler)
replay the sax events to a SAX content handles
voidpublishToHandler(ContentHandler handler)
replay the sax events to a handler
booleanremoveAttribute(Name attrName)
remove an element
voidremoveAttribute(String attrName)
remove a named attribute.
AttrremoveAttributeNode(Attr oldAttr)
remove a an attribue
voidremoveAttributeNS(String namespace, String localName)
Remove an attribute.
voidremoveContents()
remove all chidlren.
booleanremoveNamespaceDeclaration(String namespacePrefix)
remove a namespace declaration.
voidsetAllAttributes(Attributes attrs)
set all the attributes of this instance
voidsetAttribute(String namespace, String localName, String value)
Set an attribute, adding the attribute if it isn't already present in this element, and changing the value if it is.
voidsetAttribute(String name, String value)
set or update an attribute.
AttrsetAttributeNode(Attr newAttr)
set the attribute node.
AttrsetAttributeNodeNS(Attr newAttr)
set an attribute as a node
voidsetAttributeNS(String namespaceURI, String qualifiedName, String value)
set an attribute or alter an existing one
voidsetContentsIndex(int index)
set the index point of our content's starting in the event recording
voidsetEncodingStyle(String encodingStyle)
Sets the encoding style for this SOAPElement object to one specified.
voidsetEndIndex(int endIndex)
record the end index of the SAX recording.
voidsetEnvelope(SOAPEnvelope env)
bind a a new soap envelope. sets the dirty bit.
voidsetFixupDeserializer(Deserializer dser)
voidsetName(String name)
set the local part of this element's name
voidsetNamespaceURI(String nsURI)
set the namespace URI of the element
voidsetNSMappings(ArrayList namespaces)
set a new namespace mapping list
voidsetObjectValue(Object newValue)
Sets value of this node to an Object.
voidsetQName(QName qName)
set the name and namespace of this element
voidsetRecorder(SAX2EventRecorder rec)
set the event recorder
voidsetType(QName qname)
set the element's type
voidsetValue(String value)
StringtoString()
Generate a string representation by serializing our contents This is not a lightweight operation, and is repeated whenever you call this method.

Field Detail

context

protected transient DeserializationContext context

encodingStyle

protected String encodingStyle
Our encoding style, if any

endEventIndex

protected int endEventIndex

fixupDeserializer

protected Deserializer fixupDeserializer
!!! TODO : Make sure this handles multiple targets

href

protected String href

id

protected String id

log

protected static Log log

message

protected SOAPEnvelope message

namespaces

public ArrayList namespaces

qNameAttrs

protected Vector qNameAttrs

recorder

protected transient SAX2EventRecorder recorder

startContentsIndex

protected int startContentsIndex

startEventIndex

protected int startEventIndex

typeQName

protected transient QName typeQName

_isRoot

protected boolean _isRoot

Constructor Detail

MessageElement

public MessageElement()
No-arg constructor for building messages?

MessageElement

public MessageElement(String namespace, String localPart)
constructor

Parameters: namespace namespace of element localPart local name

MessageElement

public MessageElement(String localPart, String prefix, String namespace)
constructor. Automatically adds a namespace-prefix mapping to the mapping table

Parameters: localPart local name prefix prefix namespace namespace

MessageElement

public MessageElement(Name eltName)
construct using a Name implementation,

Parameters: eltName

See Also: MessageElement

MessageElement

public MessageElement(String namespace, String localPart, Object value)
constructor binding the internal object value field to the value parameter

Parameters: namespace namespace of the element localPart local name value value of the node

MessageElement

public MessageElement(QName name)
constructor declaring the qualified name of the node

Parameters: name naming information

MessageElement

public MessageElement(QName name, Object value)
constructor declaring the qualified name of the node and its value

Parameters: name naming information value value of the node

MessageElement

public MessageElement(Element elem)
create a node through a deep copy of the passed in element.

Parameters: elem name to copy from

MessageElement

public MessageElement(CharacterData text)
construct a text element.

Parameters: text text data. This is not copied; it is referred to in the MessageElement.

MessageElement

public MessageElement(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context)
Advanced constructor used for deserialization.
  1. The context provides the mappings and Sax event recorder
  2. The soap messaging style is determined from the current message context, defaulting to SOAP1.1 if there is no current context.
  3. if there is an id attribute (any namespace), then the ID is registered with DeserializationContext ;a new recorder is created if needed.
  4. If there is an attribute "root" in the default SOAP namespace, then it is examined to see if it marks the element as root (value=="1" or not)
  5. If there is an arrayType attribute then we assume we are an array and set our typeQName field appropriately.
  6. The href field is set if there is a relevant href value

Parameters: namespace namespace namespace of element localPart local name local name of element prefix prefix prefix of element attributes attributes to save as our attributes context deserialization context for this message element

Throws: AxisFault if the encoding style is not recognized/supported

Method Detail

addAttribute

public void addAttribute(String namespace, String localName, QName value)
add an attribute to the qname vector. This is a separate vector from the main attribute list.

Parameters: namespace localName value

addAttribute

public void addAttribute(String namespace, String localName, String value)
add a normal CDATA/text attribute. There is no check whether or not the attribute already exists.

Parameters: namespace namespace URI localName local anme value value

addAttribute

public void addAttribute(String attrPrefix, String namespace, String localName, String value)
add an attribute. Note that the prefix is not added to our mapping list. Also, there is no check whether or not the attribute already exists.

Parameters: attrPrefix prefix. namespace namespace URI localName value

addAttribute

public SOAPElement addAttribute(Name attrName, String value)
add a new attribute

Parameters: attrName name of the attribute value a string value

Returns: ourselves

Throws: SOAPException

See Also: SOAPElement

addChild

public void addChild(MessageElement el)
Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.

addChildElement

public SOAPElement addChildElement(Name childName)
add the child element

Parameters: childName uri, prefix and local name of the element to add

Returns: the child element

Throws: SOAPException

See Also: addChildElement

addChildElement

public SOAPElement addChildElement(String localName)
add a child element in the message element's own namespace

Parameters: localName

Returns: the child element

Throws: SOAPException

See Also: addChildElement

addChildElement

public SOAPElement addChildElement(String localName, String prefixName)
add a child element

Parameters: localName prefixName

Returns: the child element

Throws: SOAPException

See Also: SOAPElement

addChildElement

public SOAPElement addChildElement(String localName, String childPrefix, String uri)
add a child element

Parameters: localName childPrefix uri

Returns: the child element

Throws: SOAPException

See Also: SOAPElement

addChildElement

public SOAPElement addChildElement(SOAPElement element)
The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.

See Also: addChildElement

addMapping

public void addMapping(Mapping map)
add a new namespace/prefix mapping

Parameters: map new mapping to add

UNKNOWN: this code does not verify that the mapping does not exist already; it is possible to create duplicate mappings.

addNamespaceDeclaration

public SOAPElement addNamespaceDeclaration(String prefix, String uri)
create a Mapping mapping and add to our namespace list.

Parameters: prefix uri

Returns:

Throws: SOAPException for any RuntimeException caught

See Also: SOAPElement

UNKNOWN: for some reason this logic catches all rutime exceptions and rethrows them as SOAPExceptions. This is unusual behavio, and should be looked at closely.

addTextNode

public SOAPElement addTextNode(String s)
add a text node to the document.

Returns: ourselves

See Also: addTextNode

childDeepCloned

protected void childDeepCloned(NodeImpl oldNode, NodeImpl newNode)

cloneNode

public Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; ( parentNode is null.).
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute ( specified is true). Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly . In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.

Parameters: deep If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).

Returns: The duplicate node.

cloning

protected Object cloning()
protected clone method (not public) copied status ------------------- protected String name ; Y protected String prefix ; Y protected String namespaceURI ; Y protected transient Attributes attributes Y protected String id; Y? protected String href; Y? protected boolean _isRoot = true; Y? protected SOAPEnvelope message = null; N? protected transient DeserializationContext context; Y? protected transient QName typeQName = null; Y? protected Vector qNameAttrs = null; Y? protected transient SAX2EventRecorder recorder = null; N? protected int startEventIndex = 0; N? protected int startContentsIndex = 0; N? protected int endEventIndex = -1; N? protected CharacterData textRep = null; Y? protected MessageElement parent = null; N public ArrayList namespaces = null; Y protected String encodingStyle = null; N? private Object objectValue = null; N?

Returns:

Throws: CloneNotSupportedException

detachAllChildren

public void detachAllChildren()
remove all children.

equals

public boolean equals(Object obj)
equality test. Does a string match of the two message elements, so is fairly brute force.

Parameters: obj

Returns:

See Also: toString

findElement

protected MessageElement findElement(Vector vec, String namespace, String localPart)

getAllAttributes

public Iterator getAllAttributes()
Get an interator to all the attributes of the node. The iterator is over a static snapshot of the node names; if attributes are added or deleted during the iteration, this iterator will be not be updated to follow the changes.

Returns: an iterator of the attributes.

See Also: getAllAttributes

getAsDocument

public Document getAsDocument()
get the message element as a document. This serializes the element to a string and then parses it.

Returns:

Throws: Exception

See Also: getAsString

getAsDOM

public Element getAsDOM()
create a DOM from the message element, by serializing and deserializing the element

Returns: the root document element of the element

Throws: Exception

See Also: getAsString getAsDocument

getAsString

public String getAsString()
get the message element as a string. This is not a cheap operation, as we have to serialise the entire message element to the current context, then convert it to a string. Nor is it cached; repeated calls repeat the operation.

Returns: an XML fragment in a string.

Throws: Exception if anything went wrong

getAttribute

public String getAttribute(String attrName)
get an attribute by name

Parameters: attrName of attribute

Returns: the attribute value or null

See Also: org.w3c.dom.Element#getAttribute(String)

getAttributeNode

public Attr getAttributeNode(String attrName)

Deprecated: this is not implemented

This unimplemented operation is meand to return an attribute as a node

Parameters: attrName

Returns: null, always.

See Also: org.w3c.dom.Element#getAttributeNode(String)

UNKNOWN: Fix this for SAAJ 1.2 Implementation. marked as deprecated to warn people it is broken

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespace, String localName)

Deprecated: not implemented!

Parameters: namespace namespace localName local name

Returns: null

See Also: org.w3c.dom.Element#getAttributeNS(String, String)

getAttributeNS

public String getAttributeNS(String namespaceURI, String localName)
get the attribute with namespace/local name match.

Parameters: namespaceURI namespace localName name

Returns: string value or null if not found

See Also: org.w3c.dom.Element#getAttributeNS(String, String)

UNKNOWN: this could be refactored to use getAttributeValue()

getAttributesEx

public Attributes getAttributesEx()
get the attributes

Returns: attributes. If this equals NullAttributes.singleton it is null

getAttributeValue

public String getAttributeValue(String localName)
get the value of an attribute

Parameters: localName

Returns: the value or null

getAttributeValue

public String getAttributeValue(Name attrName)
Get the value of an attribute whose namespace and local name are described.

Parameters: attrName qualified name of the attribute

Returns: the attribute or null if there was no match

See Also: getAttributeValue

getChildElement

public MessageElement getChildElement(QName qname)
Convenience method to get the first matching child for a given QName.

Parameters: qname

Returns: child element or null

See Also: getChildElements

getChildElements

public Iterator getChildElements()
get an iterator over the children This iterator may get confused if changes are made to the children while the iteration is in progress.

Returns: an iterator over child elements.

See Also: getChildElements

getChildElements

public Iterator getChildElements(QName qname)
get an iterator over child elements

Parameters: qname namespace/element name of parts to find. This iterator is not (currently) susceptible to change in the element list during its lifetime, though changes in the contents of the elements are picked up.

Returns: an iterator.

getChildElements

public Iterator getChildElements(Name childName)
get an iterator over child elements

Parameters: childName namespace/element name of parts to find. This iterator is not (currently) susceptible to change in the element list during its lifetime, though changes in the contents of the elements are picked up.

Returns: an iterator.

See Also: getChildElements

getChildren

public List getChildren()
get a list of children

Returns: a list, or null if there are no children

getCompleteAttributes

public Attributes getCompleteAttributes()
Obtain an Attributes collection consisting of all attributes for this MessageElement, including namespace declarations.

Returns: Attributes collection

getDeserializationContext

public DeserializationContext getDeserializationContext()
Retrieve the DeserializationContext associated with this MessageElement

Returns: The DeserializationContext associated with this MessageElement

getElementName

public Name getElementName()
get the full name of the element

Returns:

See Also: getElementName

getElementsByTagName

public NodeList getElementsByTagName(String tagName)

Parameters: tagName tag to look for.

Returns: a list of elements

See Also: org.w3c.dom.Element#getElementsByTagName(String)

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespace, String localName)

Parameters: namespace namespace localName local name of element

Returns: (potentially empty) list of elements that match the (namespace,localname) tuple

See Also: org.w3c.dom.Element#getElementsByTagNameNS(String, String)

getElementsNS

protected NodeList getElementsNS(Element parentElement, String namespace, String localName)
helper method for recusively getting the element that has namespace URI and localname

Parameters: parentElement parent element namespace namespace localName local name of element

Returns: (potentially empty) list of elements that match the (namespace,localname) tuple

getEncodingStyle

public String getEncodingStyle()
Get the encoding style. If ours is null, walk up the hierarchy and use our parent's. Default if we're the root is "".

Returns: the currently in-scope encoding style

getEnvelope

public SOAPEnvelope getEnvelope()
get our current envelope

Returns: envelope or null.

getFixupDeserializer

public Deserializer getFixupDeserializer()

getHref

public String getHref()
get a saved href

Returns: href or null

getID

public String getID()
get a saved ID

Returns: ID or null for no ID

getLength

public int getLength()
The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

Returns: number of children

Since: SAAJ 1.2 : Nodelist Interface

See Also: org.w3c.dom.NodeList#getLength()

getName

public String getName()
get the local name of this element

Returns: name

getNamespacePrefixes

public Iterator getNamespacePrefixes()
get an iterator of the prefixes. The iterator does not get updated in response to changes in the namespace list.

Returns: an iterator over a vector of prefixes

See Also: getNamespacePrefixes

getNamespaceURI

public String getNamespaceURI(String searchPrefix)
map from a prefix to a namespace. Will recurse upward the element tree until we get a match

Parameters: searchPrefix

Returns: the prefix, or null for no match

getObjectValue

public Object getObjectValue()
Returns value of the node as an object of registered type.

Returns: Object of proper type, or null if no mapping could be found.

getObjectValue

public Object getObjectValue(Class cls)
Returns value of the node as an object of registered type.

Parameters: cls Class that contains top level deserializer metadata

Returns: Object of proper type, or null if no mapping could be found.

getOwnerDocument

public Document getOwnerDocument()

getPrefix

public String getPrefix(String searchNamespaceURI)
get the prefix for a given namespace URI

Parameters: searchNamespaceURI namespace

Returns: null for null or emtpy uri, null for no match, and the prefix iff there is a match

getQName

public QName getQName()
get the fully qualified name of this element

Returns: a QName describing the name of thsi element

getRealElement

public MessageElement getRealElement()
get the 'real' element -will follow hrefs.

Returns: the message element or null if there is a href to something that is not a MessageElemeent.

getRecorder

public SAX2EventRecorder getRecorder()
get the event recorder

Returns: recorder or null

getTagName

public String getTagName()

Returns: the name of the element

See Also: org.w3c.dom.Element#getTagName()

getType

public QName getType()
get the element's type. If we are a reference, we look up our target in the context and return (and cache) its type.

Returns:

getValue

public String getValue()
Get the value of the doc as a string. This uses getAsDOM so is a heavyweight operation.

Returns: the value of any child node, or null if there is no node/something went wrong during serialization. If the first child is text, the return value is the text itself.

See Also: ;

getValueAsType

public Object getValueAsType(QName type)

getValueAsType

public Object getValueAsType(QName type, Class cls)
This is deserialization logic mixed in to our element class. It is only valid we have a deserializer, which means that we were created using MessageElement

Parameters: type type to look up a deserializer for. cls class to use for looking up the deserializer. This takes precedence over the type field.

Returns: the value of the deserializer

Throws: Exception

getValueDOM

protected String getValueDOM()

getVisibleNamespacePrefixes

public Iterator getVisibleNamespacePrefixes()
get an iterator over visible prefixes. This includes all declared in parent elements

Returns: an iterator.

hasAttribute

public boolean hasAttribute(String attrName)
test for an attribute existing

Parameters: attrName name of attribute (or null)

Returns: true if it exists Note that the behaviour for a null parameter (returns false) is not guaranteed in future

See Also: org.w3c.dom.Element#hasAttribute(String)

hasAttributeNS

public boolean hasAttributeNS(String namespace, String localName)
Test for an attribute

Parameters: namespace localName

Returns:

See Also: org.w3c.dom.Element#hasAttributeNS(String, String)

isRoot

public boolean isRoot()
get the is-root flag

Returns: true if the element is considered a document root.

item

public Node item(int index)
get a child node

Parameters: index index value

Returns: child or null for out of range value

See Also: org.w3c.dom.NodeList#item(int)

output

public final void output(SerializationContext outputContext)
This is the public output() method, which will always simply use the recorded SAX stream for this element if it is available. If not, this method calls outputImpl() to allow subclasses and programmatically created messages to serialize themselves.

Parameters: outputContext the SerializationContext we will write to.

outputImpl

protected void outputImpl(SerializationContext outputContext)
override point -output to a serialization context.

Parameters: outputContext destination.

Throws: Exception if something went wrong.

publishContents

public void publishContents(ContentHandler handler)
replay the sax events to a SAX content handles

Parameters: handler

Throws: SAXException

publishToHandler

public void publishToHandler(ContentHandler handler)
replay the sax events to a handler

Parameters: handler

Throws: SAXException

removeAttribute

public boolean removeAttribute(Name attrName)
remove an element

Parameters: attrName name of the element

Returns: true if the attribute was found and removed.

See Also: removeAttribute

removeAttribute

public void removeAttribute(String attrName)
remove a named attribute.

Parameters: attrName name of the attributes

Throws: DOMException

See Also: org.w3c.dom.Element#removeAttribute(String)

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
remove a an attribue

Parameters: oldAttr

Returns: oldAttr

Throws: DOMException

removeAttributeNS

public void removeAttributeNS(String namespace, String localName)
Remove an attribute. If the removed attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix. If there is no matching attribute, the operation is a no-op.

Parameters: namespace namespace of attr localName local name

Throws: DOMException

See Also: org.w3c.dom.Element#removeAttributeNS(String, String)

removeContents

public void removeContents()
remove all chidlren. All SOAPExceptions which can get thrown in this process are ignored.

removeNamespaceDeclaration

public boolean removeNamespaceDeclaration(String namespacePrefix)
remove a namespace declaration.

Parameters: namespacePrefix

Returns: true if the prefix was found and removed.

See Also: removeNamespaceDeclaration

setAllAttributes

public void setAllAttributes(Attributes attrs)
set all the attributes of this instance

Parameters: attrs a new attributes list

setAttribute

public void setAttribute(String namespace, String localName, String value)
Set an attribute, adding the attribute if it isn't already present in this element, and changing the value if it is. Passing null as the value will cause any pre-existing attribute by this name to go away.

setAttribute

public void setAttribute(String name, String value)
set or update an attribute.

Parameters: name attribute name value attribute value

Throws: DOMException

See Also: org.w3c.dom.Element#setAttribute(String, String)

setAttributeNode

public Attr setAttributeNode(Attr newAttr)

Deprecated: this is not implemented

set the attribute node.

Parameters: newAttr

Returns: newAttr

Throws: DOMException

See Also: org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr)

UNKNOWN: implement

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
set an attribute as a node

Parameters: newAttr

Returns: null

Throws: DOMException

See Also: org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr)

UNKNOWN: implement properly.

setAttributeNS

public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
set an attribute or alter an existing one

Parameters: namespaceURI namepsace qualifiedName qualified name of the attribue value value

Throws: DOMException

See Also: org.w3c.dom.Element#setAttributeNS(String, String, String)

setContentsIndex

public void setContentsIndex(int index)
set the index point of our content's starting in the event recording

Parameters: index index value of the first event of our recorder.

setEncodingStyle

public void setEncodingStyle(String encodingStyle)
Sets the encoding style for this SOAPElement object to one specified. The semantics of a null value, as above in getEncodingStyle() are to just use the parent's value, but null here means set to "".

Parameters: encodingStyle a String giving the encoding style

Throws: java.lang.IllegalArgumentException if there was a problem in the encoding style being set.

See Also: getEncodingStyle()

setEndIndex

public void setEndIndex(int endIndex)
record the end index of the SAX recording.

Parameters: endIndex end value

setEnvelope

public void setEnvelope(SOAPEnvelope env)
bind a a new soap envelope. sets the dirty bit.

Parameters: env

setFixupDeserializer

public void setFixupDeserializer(Deserializer dser)

setName

public void setName(String name)
set the local part of this element's name

Parameters: name

setNamespaceURI

public void setNamespaceURI(String nsURI)
set the namespace URI of the element

Parameters: nsURI new namespace URI

setNSMappings

public void setNSMappings(ArrayList namespaces)
set a new namespace mapping list

Parameters: namespaces

setObjectValue

public void setObjectValue(Object newValue)
Sets value of this node to an Object. A serializer needs to be registered for this object class for proper operation.

Note that this method will log an error and no-op if there are any children in the MessageElement or if the MessageElement was constructed from XML.

Parameters: newValue node's value or null.

setQName

public void setQName(QName qName)
set the name and namespace of this element

Parameters: qName qualified name

setRecorder

public void setRecorder(SAX2EventRecorder rec)
set the event recorder

Parameters: rec

setType

public void setType(QName qname)
set the element's type

Parameters: qname

setValue

public void setValue(String value)

toString

public String toString()
Generate a string representation by serializing our contents This is not a lightweight operation, and is repeated whenever you call this method. If the serialization fails, an error is logged and the classic Object#toString() operation invoked instead.

Returns: a string representing the class

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.