|
|||||||||
Home >> All >> org >> apache >> axis >> [ message overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
org.apache.axis.message
Class MessageElement

java.lang.Objectorg.apache.axis.message.NodeImpl
org.apache.axis.message.MessageElement
- All Implemented Interfaces:
- java.lang.Cloneable, org.w3c.dom.Element, javax.xml.soap.Node, org.w3c.dom.Node, org.w3c.dom.NodeList, java.io.Serializable, javax.xml.soap.SOAPElement
- Direct Known Subclasses:
- DetailEntry, RPCParam, SOAPBody, SOAPBodyElement, SOAPEnvelope, SOAPFaultElement, SOAPHeader, SOAPHeaderElement
- public class MessageElement
- extends NodeImpl
- implements javax.xml.soap.SOAPElement, java.io.Serializable, org.w3c.dom.NodeList, java.lang.Cloneable
- extends NodeImpl
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.
Nested Class Summary | |
protected static class |
MessageElement.QNameAttr
class that represents a qname in a the qNameAttrs vector. |
Field Summary | |
protected boolean |
_isRoot
|
protected org.apache.axis.encoding.DeserializationContext |
context
|
private static org.apache.axis.utils.Mapping |
enc11Mapping
|
private static org.apache.axis.utils.Mapping |
enc12Mapping
|
protected java.lang.String |
encodingStyle
Our encoding style, if any |
protected int |
endEventIndex
|
protected org.apache.axis.encoding.Deserializer |
fixupDeserializer
!!! TODO : Make sure this handles multiple targets |
protected java.lang.String |
href
|
protected java.lang.String |
id
|
protected static org.apache.commons.logging.Log |
log
|
protected SOAPEnvelope |
message
|
java.util.ArrayList |
namespaces
|
private java.lang.Object |
objectValue
Object value, possibly supplied by subclass |
protected java.util.Vector |
qNameAttrs
|
protected SAX2EventRecorder |
recorder
|
protected int |
startContentsIndex
|
protected int |
startEventIndex
|
protected javax.xml.namespace.QName |
typeQName
|
Fields inherited from class org.apache.axis.message.NodeImpl |
_isDirty, attributes, children, document, name, namespaceURI, parent, prefix, textRep |
Constructor Summary | |
MessageElement()
No-arg constructor for building messages? |
|
MessageElement(org.w3c.dom.CharacterData text)
construct a text element. |
|
MessageElement(org.w3c.dom.Element elem)
create a node through a deep copy of the passed in element. |
|
MessageElement(javax.xml.soap.Name eltName)
construct using a javax.xml.soap.Name implementation, |
|
MessageElement(javax.xml.namespace.QName name)
constructor declaring the qualified name of the node |
|
MessageElement(javax.xml.namespace.QName name,
java.lang.Object value)
constructor declaring the qualified name of the node and its value |
|
MessageElement(java.lang.String namespace,
java.lang.String localPart)
constructor |
|
MessageElement(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object value)
constructor binding the internal object value field to the value parameter |
|
MessageElement(java.lang.String localPart,
java.lang.String prefix,
java.lang.String namespace)
constructor. |
|
MessageElement(java.lang.String namespace,
java.lang.String localPart,
java.lang.String prefix,
org.xml.sax.Attributes attributes,
org.apache.axis.encoding.DeserializationContext context)
Advanced constructor used for deserialization. |
Method Summary | |
javax.xml.soap.SOAPElement |
addAttribute(javax.xml.soap.Name attrName,
java.lang.String value)
add a new attribute |
void |
addAttribute(java.lang.String namespace,
java.lang.String localName,
javax.xml.namespace.QName value)
add an attribute to the qname vector. |
void |
addAttribute(java.lang.String namespace,
java.lang.String localName,
java.lang.String value)
add a normal CDATA/text attribute. |
void |
addAttribute(java.lang.String attrPrefix,
java.lang.String namespace,
java.lang.String localName,
java.lang.String value)
add an attribute. |
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. |
javax.xml.soap.SOAPElement |
addChildElement(javax.xml.soap.Name childName)
add the child element |
javax.xml.soap.SOAPElement |
addChildElement(javax.xml.soap.SOAPElement element)
The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown. |
javax.xml.soap.SOAPElement |
addChildElement(java.lang.String localName)
add a child element in the message element's own namespace |
javax.xml.soap.SOAPElement |
addChildElement(java.lang.String localName,
java.lang.String prefixName)
add a child element |
javax.xml.soap.SOAPElement |
addChildElement(java.lang.String localName,
java.lang.String childPrefix,
java.lang.String uri)
add a child element |
void |
addMapping(org.apache.axis.utils.Mapping map)
add a new namespace/prefix mapping |
javax.xml.soap.SOAPElement |
addNamespaceDeclaration(java.lang.String prefix,
java.lang.String uri)
create a org.apache.axis.utils.Mapping mapping and add to our namespace list. |
javax.xml.soap.SOAPElement |
addTextNode(java.lang.String s)
add a text node to the document. |
protected void |
childDeepCloned(NodeImpl oldNode,
NodeImpl newNode)
|
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
protected java.lang.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? |
private void |
copyNode(MessageElement dest,
org.w3c.dom.Node source)
recursive copy |
private void |
copyNode(org.w3c.dom.Node element)
recursively copy. |
void |
detachAllChildren()
remove all children. |
boolean |
equals(java.lang.Object obj)
equality test. |
protected MessageElement |
findElement(java.util.Vector vec,
java.lang.String namespace,
java.lang.String localPart)
|
java.util.Iterator |
getAllAttributes()
Get an interator to all the attributes of the node. |
org.w3c.dom.Document |
getAsDocument()
get the message element as a document. |
org.w3c.dom.Element |
getAsDOM()
create a DOM from the message element, by serializing and deserializing the element |
java.lang.String |
getAsString()
get the message element as a string. |
java.lang.String |
getAttribute(java.lang.String attrName)
get an attribute by name |
org.w3c.dom.Attr |
getAttributeNode(java.lang.String attrName)
Deprecated. this is not implemented |
org.w3c.dom.Attr |
getAttributeNodeNS(java.lang.String namespace,
java.lang.String localName)
Retrieves an Attr node by local name and namespace URI. |
java.lang.String |
getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
get the attribute with namespace/local name match. |
org.xml.sax.Attributes |
getAttributesEx()
get the attributes |
java.lang.String |
getAttributeValue(javax.xml.soap.Name attrName)
Get the value of an attribute whose namespace and local name are described. |
java.lang.String |
getAttributeValue(java.lang.String localName)
get the value of an attribute |
MessageElement |
getChildElement(javax.xml.namespace.QName qname)
Convenience method to get the first matching child for a given QName. |
java.util.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. |
java.util.Iterator |
getChildElements(javax.xml.soap.Name childName)
get an iterator over child elements |
java.util.Iterator |
getChildElements(javax.xml.namespace.QName qname)
get an iterator over child elements |
java.util.List |
getChildren()
get a list of children |
org.xml.sax.Attributes |
getCompleteAttributes()
Obtain an Attributes collection consisting of all attributes for this MessageElement, including namespace declarations. |
org.apache.axis.encoding.DeserializationContext |
getDeserializationContext()
Retrieve the DeserializationContext associated with this MessageElement |
javax.xml.soap.Name |
getElementName()
get the full name of the element |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagName)
Returns a NodeList of all descendant Elements
with a given tag name, in document order. |
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespace,
java.lang.String localName)
Returns a NodeList of all the descendant
Elements with a given local name and namespace URI in
document order. |
protected org.w3c.dom.NodeList |
getElementsNS(org.w3c.dom.Element parentElement,
java.lang.String namespace,
java.lang.String localName)
helper method for recusively getting the element that has namespace URI and localname |
java.lang.String |
getEncodingStyle()
Get the encoding style. |
SOAPEnvelope |
getEnvelope()
get our current envelope |
org.apache.axis.encoding.Deserializer |
getFixupDeserializer()
|
java.lang.String |
getHref()
get a saved href |
java.lang.String |
getID()
get a saved ID |
int |
getLength()
The number of nodes in the list. |
java.lang.String |
getName()
get the local name of this element |
java.util.Iterator |
getNamespacePrefixes()
get an iterator of the prefixes. |
java.lang.String |
getNamespaceURI(java.lang.String searchPrefix)
map from a prefix to a namespace. |
java.lang.Object |
getObjectValue()
Returns value of the node as an object of registered type. |
java.lang.Object |
getObjectValue(java.lang.Class cls)
Returns value of the node as an object of registered type. |
org.w3c.dom.Document |
getOwnerDocument()
The Document object associated with this node. |
java.lang.String |
getPrefix(java.lang.String searchNamespaceURI)
get the prefix for a given namespace URI |
javax.xml.namespace.QName |
getQName()
get the fully qualified name of this element |
MessageElement |
getRealElement()
get the 'real' element -will follow hrefs. |
SAX2EventRecorder |
getRecorder()
get the event recorder |
java.lang.String |
getTagName()
The name of the element. |
javax.xml.namespace.QName |
getType()
get the element's type. |
java.lang.String |
getValue()
Get the value of the doc as a string. |
java.lang.Object |
getValueAsType(javax.xml.namespace.QName type)
|
java.lang.Object |
getValueAsType(javax.xml.namespace.QName type,
java.lang.Class cls)
This is deserialization logic mixed in to our element class. |
protected java.lang.String |
getValueDOM()
|
java.util.Iterator |
getVisibleNamespacePrefixes()
get an iterator over visible prefixes. |
boolean |
hasAttribute(java.lang.String attrName)
test for an attribute existing |
boolean |
hasAttributeNS(java.lang.String namespace,
java.lang.String localName)
Test for an attribute |
boolean |
isRoot()
get the is-root flag |
org.w3c.dom.Node |
item(int index)
get a child node |
void |
output(org.apache.axis.encoding.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 void |
outputImpl(org.apache.axis.encoding.SerializationContext outputContext)
override point -output to a serialization context. |
void |
publishContents(org.xml.sax.ContentHandler handler)
replay the sax events to a SAX content handles |
void |
publishToHandler(org.xml.sax.ContentHandler handler)
replay the sax events to a handler |
boolean |
removeAttribute(javax.xml.soap.Name attrName)
remove an element |
void |
removeAttribute(java.lang.String attrName)
remove a named attribute. |
org.w3c.dom.Attr |
removeAttributeNode(org.w3c.dom.Attr oldAttr)
remove a an attribue |
void |
removeAttributeNS(java.lang.String namespace,
java.lang.String localName)
Remove an attribute. |
void |
removeContents()
remove all chidlren. |
boolean |
removeNamespaceDeclaration(java.lang.String namespacePrefix)
remove a namespace declaration. |
void |
setAllAttributes(org.xml.sax.Attributes attrs)
set all the attributes of this instance |
void |
setAttribute(java.lang.String name,
java.lang.String value)
set or update an attribute. |
void |
setAttribute(java.lang.String namespace,
java.lang.String localName,
java.lang.String value)
Set an attribute, adding the attribute if it isn't already present in this element, and changing the value if it is. |
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr newAttr)
Deprecated. this is not implemented |
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
set an attribute as a node |
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
set an attribute or alter an existing one |
void |
setContentsIndex(int index)
set the index point of our content's starting in the event recording |
void |
setEncodingStyle(java.lang.String encodingStyle)
Sets the encoding style for this SOAPElement
object to one specified. |
void |
setEndIndex(int endIndex)
record the end index of the SAX recording. |
void |
setEnvelope(SOAPEnvelope env)
bind a a new soap envelope. |
void |
setFixupDeserializer(org.apache.axis.encoding.Deserializer dser)
|
void |
setName(java.lang.String name)
set the local part of this element's name |
void |
setNamespaceURI(java.lang.String nsURI)
set the namespace URI of the element |
void |
setNSMappings(java.util.ArrayList namespaces)
set a new namespace mapping list |
void |
setObjectValue(java.lang.Object newValue)
Sets value of this node to an Object. |
void |
setQName(javax.xml.namespace.QName qName)
set the name and namespace of this element |
void |
setRecorder(SAX2EventRecorder rec)
set the event recorder |
void |
setType(javax.xml.namespace.QName qname)
set the element's type |
void |
setValue(java.lang.String value)
If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node. |
java.lang.String |
toString()
Generate a string representation by serializing our contents This is not a lightweight operation, and is repeated whenever you call this method. |
Methods inherited from class org.apache.axis.message.NodeImpl |
appendChild, convertAttrSAXtoDOM, detachNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, initializeChildren, insertBefore, isDirty, isSupported, makeAttributesEditable, normalize, recycleNode, removeChild, replaceChild, setDirty, setNodeValue, setOwnerDocument, setParent, setParentElement, setPrefix |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.xml.soap.Node |
detachNode, getParentElement, recycleNode, setParentElement |
Methods inherited from interface org.w3c.dom.Node |
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Methods inherited from interface org.w3c.dom.Element |
getSchemaTypeInfo, setIdAttribute, setIdAttributeNode, setIdAttributeNS |
Field Detail |
log
protected static org.apache.commons.logging.Log log
enc11Mapping
private static final org.apache.axis.utils.Mapping enc11Mapping
enc12Mapping
private static final org.apache.axis.utils.Mapping enc12Mapping
id
protected java.lang.String id
href
protected java.lang.String href
_isRoot
protected boolean _isRoot
message
protected SOAPEnvelope message
context
protected transient org.apache.axis.encoding.DeserializationContext context
typeQName
protected transient javax.xml.namespace.QName typeQName
qNameAttrs
protected java.util.Vector qNameAttrs
recorder
protected transient SAX2EventRecorder recorder
startEventIndex
protected int startEventIndex
startContentsIndex
protected int startContentsIndex
endEventIndex
protected int endEventIndex
namespaces
public java.util.ArrayList namespaces
encodingStyle
protected java.lang.String encodingStyle
- Our encoding style, if any
objectValue
private java.lang.Object objectValue
- Object value, possibly supplied by subclass
fixupDeserializer
protected org.apache.axis.encoding.Deserializer fixupDeserializer
- !!! TODO : Make sure this handles multiple targets
Constructor Detail |
MessageElement
public MessageElement()
- No-arg constructor for building messages?
MessageElement
public MessageElement(java.lang.String namespace, java.lang.String localPart)
- constructor
MessageElement
public MessageElement(java.lang.String localPart, java.lang.String prefix, java.lang.String namespace)
- constructor. Automatically adds a namespace-prefix mapping to the mapping table
MessageElement
public MessageElement(javax.xml.soap.Name eltName)
- construct using a javax.xml.soap.Name implementation,
MessageElement
public MessageElement(java.lang.String namespace, java.lang.String localPart, java.lang.Object value)
- constructor binding the internal object value field to the
value parameter
MessageElement
public MessageElement(javax.xml.namespace.QName name)
- constructor declaring the qualified name of the node
MessageElement
public MessageElement(javax.xml.namespace.QName name, java.lang.Object value)
- constructor declaring the qualified name of the node
and its value
MessageElement
public MessageElement(org.w3c.dom.Element elem)
- create a node through a deep copy of the passed in element.
MessageElement
public MessageElement(org.w3c.dom.CharacterData text)
- construct a text element.
MessageElement
public MessageElement(java.lang.String namespace, java.lang.String localPart, java.lang.String prefix, org.xml.sax.Attributes attributes, org.apache.axis.encoding.DeserializationContext context) throws org.apache.axis.AxisFault
- Advanced constructor used for deserialization.
- The context provides the mappings and Sax event recorder
- The soap messaging style is determined from the current message context, defaulting to SOAP1.1 if there is no current context.
- if there is an id attribute (any namespace), then the ID is registered
with DeserializationContext.registerElementByID(String, MessageElement)>
DeserializationContext.registerElementByID(String, MessageElement)
55 ;a new recorder is created if needed. - 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)
- If there is an arrayType attribute then we assume we are an array and set our
typeQName
55 field appropriately. - The
href
55 field is set if there is a relevant href value
Method Detail |
getDeserializationContext
public org.apache.axis.encoding.DeserializationContext getDeserializationContext()
- Retrieve the DeserializationContext associated with this MessageElement
setFixupDeserializer
public void setFixupDeserializer(org.apache.axis.encoding.Deserializer dser)
getFixupDeserializer
public org.apache.axis.encoding.Deserializer getFixupDeserializer()
setEndIndex
public void setEndIndex(int endIndex)
- record the end index of the SAX recording.
isRoot
public boolean isRoot()
- get the is-root flag
getID
public java.lang.String getID()
- get a saved ID
getHref
public java.lang.String getHref()
- get a saved href
getAttributesEx
public org.xml.sax.Attributes getAttributesEx()
- get the attributes
cloneNode
public org.w3c.dom.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
isnull
.).
Cloning anElement
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 childText
node. Cloning anAttribute
directly, as opposed to be cloned as part of anElement
cloning operation, returns a specified attribute (specified
istrue
). 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 anEntityReference
clone are readonly . In addition, clones of unspecifiedAttr
nodes are specified. And, cloningDocument
,DocumentType
,Entity
, andNotation
nodes is implementation dependent.- Specified by:
cloneNode
in interfaceorg.w3c.dom.Node
- Overrides:
cloneNode
in classNodeImpl
childDeepCloned
protected void childDeepCloned(NodeImpl oldNode, NodeImpl newNode)
cloning
protected java.lang.Object cloning() throws java.lang.CloneNotSupportedException
- 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?
setAllAttributes
public void setAllAttributes(org.xml.sax.Attributes attrs)
- set all the attributes of this instance
detachAllChildren
public void detachAllChildren()
- remove all children.
getCompleteAttributes
public org.xml.sax.Attributes getCompleteAttributes()
- Obtain an Attributes collection consisting of all attributes
for this MessageElement, including namespace declarations.
getName
public java.lang.String getName()
- get the local name of this element
setName
public void setName(java.lang.String name)
- set the local part of this element's name
getQName
public javax.xml.namespace.QName getQName()
- get the fully qualified name of this element
setQName
public void setQName(javax.xml.namespace.QName qName)
- set the name and namespace of this element
setNamespaceURI
public void setNamespaceURI(java.lang.String nsURI)
- set the namespace URI of the element
getType
public javax.xml.namespace.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.
setType
public void setType(javax.xml.namespace.QName qname)
- set the element's type
getRecorder
public SAX2EventRecorder getRecorder()
- get the event recorder
setRecorder
public void setRecorder(SAX2EventRecorder rec)
- set the event recorder
getEncodingStyle
public java.lang.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 "".
- Specified by:
getEncodingStyle
in interfacejavax.xml.soap.SOAPElement
removeContents
public void removeContents()
- remove all chidlren.
All SOAPExceptions which can get thrown in this process are ignored.
- Specified by:
removeContents
in interfacejavax.xml.soap.SOAPElement
getVisibleNamespacePrefixes
public java.util.Iterator getVisibleNamespacePrefixes()
- get an iterator over visible prefixes. This includes all declared in
parent elements
- Specified by:
getVisibleNamespacePrefixes
in interfacejavax.xml.soap.SOAPElement
setEncodingStyle
public void setEncodingStyle(java.lang.String encodingStyle) throws javax.xml.soap.SOAPException
- 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 "".- Specified by:
setEncodingStyle
in interfacejavax.xml.soap.SOAPElement
addChild
public void addChild(MessageElement el) throws javax.xml.soap.SOAPException
- Note that this method will log a error and no-op if there is
a value (set using setObjectValue) in the MessageElement.
getChildren
public java.util.List getChildren()
- get a list of children
setContentsIndex
public void setContentsIndex(int index)
- set the index point of our content's starting in the
event recording
setNSMappings
public void setNSMappings(java.util.ArrayList namespaces)
- set a new namespace mapping list
getPrefix
public java.lang.String getPrefix(java.lang.String searchNamespaceURI)
- get the prefix for a given namespace URI
getNamespaceURI
public java.lang.String getNamespaceURI(java.lang.String searchPrefix)
- map from a prefix to a namespace.
Will recurse upward the element tree until we get a match
- Specified by:
getNamespaceURI
in interfacejavax.xml.soap.SOAPElement
getObjectValue
public java.lang.Object getObjectValue()
- Returns value of the node as an object of registered type.
getObjectValue
public java.lang.Object getObjectValue(java.lang.Class cls) throws java.lang.Exception
- Returns value of the node as an object of registered type.
setObjectValue
public void setObjectValue(java.lang.Object newValue) throws javax.xml.soap.SOAPException
- 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.
getValueAsType
public java.lang.Object getValueAsType(javax.xml.namespace.QName type) throws java.lang.Exception
getValueAsType
public java.lang.Object getValueAsType(javax.xml.namespace.QName type, java.lang.Class cls) throws java.lang.Exception
- 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(String, String, String, org.xml.sax.Attributes, org.apache.axis.encoding.DeserializationContext)
55
addAttribute
public void addAttribute(java.lang.String namespace, java.lang.String localName, javax.xml.namespace.QName value)
- add an attribute to the qname vector. This is a separate vector from the
main attribute list.
addAttribute
public void addAttribute(java.lang.String namespace, java.lang.String localName, java.lang.String value)
- add a normal CDATA/text attribute.
There is no check whether or not the attribute already exists.
addAttribute
public void addAttribute(java.lang.String attrPrefix, java.lang.String namespace, java.lang.String localName, java.lang.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.
setAttribute
public void setAttribute(java.lang.String namespace, java.lang.String localName, java.lang.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.
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String localName)
- get the value of an attribute
setEnvelope
public void setEnvelope(SOAPEnvelope env)
- bind a a new soap envelope. sets the dirty bit.
getEnvelope
public SOAPEnvelope getEnvelope()
- get our current envelope
getRealElement
public MessageElement getRealElement()
- get the 'real' element -will follow hrefs.
getAsDocument
public org.w3c.dom.Document getAsDocument() throws java.lang.Exception
- get the message element as a document.
This serializes the element to a string and then parses it.
getAsString
public java.lang.String getAsString() throws java.lang.Exception
- 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.
getAsDOM
public org.w3c.dom.Element getAsDOM() throws java.lang.Exception
- create a DOM from the message element, by
serializing and deserializing the element
publishToHandler
public void publishToHandler(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
- replay the sax events to a handler
publishContents
public void publishContents(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
- replay the sax events to a SAX content handles
output
public final void output(org.apache.axis.encoding.SerializationContext outputContext) throws java.lang.Exception
- 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.
outputImpl
protected void outputImpl(org.apache.axis.encoding.SerializationContext outputContext) throws java.lang.Exception
- override point -output to a serialization context.
toString
public java.lang.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()>
Object.toString()
55 operation invoked instead.
addMapping
public void addMapping(org.apache.axis.utils.Mapping map)
- add a new namespace/prefix mapping
addChildElement
public javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.Name childName) throws javax.xml.soap.SOAPException
- add the child element
- Specified by:
addChildElement
in interfacejavax.xml.soap.SOAPElement
addChildElement
public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName) throws javax.xml.soap.SOAPException
- add a child element in the message element's own namespace
- Specified by:
addChildElement
in interfacejavax.xml.soap.SOAPElement
addChildElement
public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName, java.lang.String prefixName) throws javax.xml.soap.SOAPException
- add a child element
- Specified by:
addChildElement
in interfacejavax.xml.soap.SOAPElement
addChildElement
public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName, java.lang.String childPrefix, java.lang.String uri) throws javax.xml.soap.SOAPException
- add a child element
- Specified by:
addChildElement
in interfacejavax.xml.soap.SOAPElement
addChildElement
public javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.SOAPElement element) throws javax.xml.soap.SOAPException
- The added child must be an instance of MessageElement rather than
an abitrary SOAPElement otherwise a (wrapped) ClassCastException
will be thrown.
- Specified by:
addChildElement
in interfacejavax.xml.soap.SOAPElement
addTextNode
public javax.xml.soap.SOAPElement addTextNode(java.lang.String s) throws javax.xml.soap.SOAPException
- add a text node to the document.
- Specified by:
addTextNode
in interfacejavax.xml.soap.SOAPElement
addAttribute
public javax.xml.soap.SOAPElement addAttribute(javax.xml.soap.Name attrName, java.lang.String value) throws javax.xml.soap.SOAPException
- add a new attribute
- Specified by:
addAttribute
in interfacejavax.xml.soap.SOAPElement
addNamespaceDeclaration
public javax.xml.soap.SOAPElement addNamespaceDeclaration(java.lang.String prefix, java.lang.String uri) throws javax.xml.soap.SOAPException
- create a org.apache.axis.utils.Mapping mapping and add to our namespace list.
- Specified by:
addNamespaceDeclaration
in interfacejavax.xml.soap.SOAPElement
getAttributeValue
public java.lang.String getAttributeValue(javax.xml.soap.Name attrName)
- Get the value of an attribute whose namespace and local name are described.
- Specified by:
getAttributeValue
in interfacejavax.xml.soap.SOAPElement
getAllAttributes
public java.util.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.
- Specified by:
getAllAttributes
in interfacejavax.xml.soap.SOAPElement
getNamespacePrefixes
public java.util.Iterator getNamespacePrefixes()
- get an iterator of the prefixes. The iterator
does not get updated in response to changes in the namespace list.
- Specified by:
getNamespacePrefixes
in interfacejavax.xml.soap.SOAPElement
getElementName
public javax.xml.soap.Name getElementName()
- get the full name of the element
- Specified by:
getElementName
in interfacejavax.xml.soap.SOAPElement
removeAttribute
public boolean removeAttribute(javax.xml.soap.Name attrName)
- remove an element
- Specified by:
removeAttribute
in interfacejavax.xml.soap.SOAPElement
removeNamespaceDeclaration
public boolean removeNamespaceDeclaration(java.lang.String namespacePrefix)
- remove a namespace declaration.
- Specified by:
removeNamespaceDeclaration
in interfacejavax.xml.soap.SOAPElement
getChildElements
public java.util.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.
- Specified by:
getChildElements
in interfacejavax.xml.soap.SOAPElement
getChildElement
public MessageElement getChildElement(javax.xml.namespace.QName qname)
- Convenience method to get the first matching child for a given QName.
getChildElements
public java.util.Iterator getChildElements(javax.xml.namespace.QName qname)
- get an iterator over child elements
getChildElements
public java.util.Iterator getChildElements(javax.xml.soap.Name childName)
- get an iterator over child elements
- Specified by:
getChildElements
in interfacejavax.xml.soap.SOAPElement
getTagName
public java.lang.String getTagName()
- Description copied from interface:
org.w3c.dom.Element
- The name of the element. If
Node.localName
is different fromnull
, this attribute is a qualified name. For example, in:<elementExample id="demo"> ... </elementExample> ,
tagName
has the value"elementExample"
. Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns thetagName
of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.- Specified by:
getTagName
in interfaceorg.w3c.dom.Element
removeAttribute
public void removeAttribute(java.lang.String attrName) throws org.w3c.dom.DOMException
- remove a named attribute.
- Specified by:
removeAttribute
in interfaceorg.w3c.dom.Element
hasAttribute
public boolean hasAttribute(java.lang.String attrName)
- test for an attribute existing
- Specified by:
hasAttribute
in interfaceorg.w3c.dom.Element
getAttribute
public java.lang.String getAttribute(java.lang.String attrName)
- get an attribute by name
- Specified by:
getAttribute
in interfaceorg.w3c.dom.Element
removeAttributeNS
public void removeAttributeNS(java.lang.String namespace, java.lang.String localName) throws org.w3c.dom.DOMException
- 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.
- Specified by:
removeAttributeNS
in interfaceorg.w3c.dom.Element
setAttribute
public void setAttribute(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
- set or update an attribute.
- Specified by:
setAttribute
in interfaceorg.w3c.dom.Element
hasAttributeNS
public boolean hasAttributeNS(java.lang.String namespace, java.lang.String localName)
- Test for an attribute
- Specified by:
hasAttributeNS
in interfaceorg.w3c.dom.Element
getAttributeNode
public org.w3c.dom.Attr getAttributeNode(java.lang.String attrName)
- Deprecated. this is not implemented
- This unimplemented operation is meand to return an attribute as a node
- Specified by:
getAttributeNode
in interfaceorg.w3c.dom.Element
- This unimplemented operation is meand to return an attribute as a node
removeAttributeNode
public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr) throws org.w3c.dom.DOMException
- remove a an attribue
- Specified by:
removeAttributeNode
in interfaceorg.w3c.dom.Element
setAttributeNode
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
- Deprecated. this is not implemented
- set the attribute node.
- Specified by:
setAttributeNode
in interfaceorg.w3c.dom.Element
- set the attribute node.
setAttributeNodeNS
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
- set an attribute as a node
- Specified by:
setAttributeNodeNS
in interfaceorg.w3c.dom.Element
getElementsByTagName
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
- Description copied from interface:
org.w3c.dom.Element
- Returns a
NodeList
of all descendantElements
with a given tag name, in document order.- Specified by:
getElementsByTagName
in interfaceorg.w3c.dom.Element
getAttributeNS
public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
- get the attribute with namespace/local name match.
- Specified by:
getAttributeNS
in interfaceorg.w3c.dom.Element
setAttributeNS
public void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value) throws org.w3c.dom.DOMException
- set an attribute or alter an existing one
- Specified by:
setAttributeNS
in interfaceorg.w3c.dom.Element
getAttributeNodeNS
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespace, java.lang.String localName)
- Deprecated. not implemented!
- Description copied from interface:
org.w3c.dom.Element
- Retrieves an
Attr
node by local name and namespace URI.
Per [XML Namespaces] , applications must use the valuenull
as thenamespaceURI
parameter for methods if they wish to have no namespace.- Specified by:
getAttributeNodeNS
in interfaceorg.w3c.dom.Element
- Description copied from interface:
getElementsByTagNameNS
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespace, java.lang.String localName)
- Description copied from interface:
org.w3c.dom.Element
- Returns a
NodeList
of all the descendantElements
with a given local name and namespace URI in document order.- Specified by:
getElementsByTagNameNS
in interfaceorg.w3c.dom.Element
getElementsNS
protected org.w3c.dom.NodeList getElementsNS(org.w3c.dom.Element parentElement, java.lang.String namespace, java.lang.String localName)
- helper method for recusively getting the element that has namespace URI and localname
item
public org.w3c.dom.Node item(int index)
- get a child node
- Specified by:
item
in interfaceorg.w3c.dom.NodeList
getLength
public int getLength()
- The number of nodes in the list. The range of valid child node indices
is 0 to
length-1
inclusive.- Specified by:
getLength
in interfaceorg.w3c.dom.NodeList
- Since:
- SAAJ 1.2 : Nodelist Interface
findElement
protected MessageElement findElement(java.util.Vector vec, java.lang.String namespace, java.lang.String localPart)
equals
public boolean equals(java.lang.Object obj)
- equality test. Does a string match of the two message elements,
so is fairly brute force.
copyNode
private void copyNode(org.w3c.dom.Node element)
- recursively copy.
Note that this does not reset many of our fields, and must be used with caution.
copyNode
private void copyNode(MessageElement dest, org.w3c.dom.Node source)
- recursive copy
getValue
public java.lang.String getValue()
- Get the value of the doc as a string.
This uses
getAsDOM()
55 so is a heavyweight operation.- Specified by:
getValue
in interfacejavax.xml.soap.Node
- Overrides:
getValue
in classNodeImpl
getValueDOM
protected java.lang.String getValueDOM()
setValue
public void setValue(java.lang.String value)
- Description copied from interface:
javax.xml.soap.Node
- If this is a Text node then this method will set its value, otherwise it
sets the value of the immediate (Text) child of this node. The value of
the immediate child of this node can be set only if, there is one child
node and that node is a Text node, or if there are no children in which
case a child Text node will be created.
- Specified by:
setValue
in interfacejavax.xml.soap.Node
- Overrides:
setValue
in classNodeImpl
getOwnerDocument
public org.w3c.dom.Document getOwnerDocument()
- Description copied from interface:
org.w3c.dom.Node
- The
Document
object associated with this node. This is also theDocument
object used to create new nodes. When this node is aDocument
or aDocumentType
which is not used with anyDocument
yet, this isnull
.- Specified by:
getOwnerDocument
in interfaceorg.w3c.dom.Node
- Overrides:
getOwnerDocument
in classNodeImpl
|
|||||||||
Home >> All >> org >> apache >> axis >> [ message overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |