public class SOAPContentElement extends SOAPElementImpl implements SOAPContentAccess
The SOAPContentElement has three content representations, which may not exist in parallel. The getter and setter of the content properties perform the conversions.
+---------+ +-------------+ +-------------+ | Object | <-----> | XMLFragment | <-----> | DOMTree | +---------+ +-------------+ +-------------+The idea is, that handlers can work with both the object and the dom view of this SOAPElement. Note that transitions may be expensive.
ObjectContent
,
XMLContent
,
DOMContent
Modifier and Type | Field and Description |
---|---|
static QName |
GENERIC_PARAM_NAME |
static QName |
GENERIC_RETURN_NAME |
protected SOAPContent |
soapContent |
domNode, soapParent
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
SOAPContentElement(Name name)
Construct a SOAPContentElement
|
SOAPContentElement(QName qname) |
SOAPContentElement(SOAPElementImpl element) |
Modifier and Type | Method and Description |
---|---|
void |
accept(SAAJVisitor visitor) |
SOAPElement |
addAttribute(Name name,
String value)
Adds an attribute with the specified name and value to this SOAPElement object.
|
SOAPElement |
addChildElement(Name name)
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
|
SOAPElement |
addChildElement(SOAPElement child)
Add a SOAPElement as a child of this SOAPElement instance.
|
SOAPElement |
addChildElement(String name)
Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object.
|
SOAPElement |
addChildElement(String localName,
String prefix)
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
|
SOAPElement |
addChildElement(String localName,
String prefix,
String uri)
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
|
SOAPElement |
addNamespaceDeclaration(String prefix,
String nsURI)
Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.
|
SOAPElement |
addTextNode(String value)
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
|
Node |
appendChild(Node newChild) |
Node |
cloneNode(boolean deep) |
Iterator<Name> |
getAllAttributes()
Returns an Iterator over all of the attribute Name objects in this SOAPElement object.
|
String |
getAttribute(String name) |
Attr |
getAttributeNode(String name) |
Attr |
getAttributeNodeNS(String namespaceURI,
String localName) |
String |
getAttributeNS(String namespaceURI,
String localName) |
NamedNodeMap |
getAttributes() |
String |
getAttributeValue(Name name)
Returns the value of the attribute with the specified name.
|
Iterator<Node> |
getChildElements()
Returns an Iterator over all the immediate child Nodes of this element.
|
Iterator<SOAPElement> |
getChildElements(Name name)
Returns an Iterator over all the immediate child Nodes of this element with the specified name.
|
NodeList |
getChildNodes() |
Name |
getElementName()
Returns the name of this SOAPElement object.
|
NodeList |
getElementsByTagName(String name) |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName) |
String |
getEncodingStyle()
Returns the encoding style for this SOAPElement object.
|
Node |
getFirstChild() |
Class |
getJavaType() |
Node |
getLastChild() |
Iterator<String> |
getNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings declared by this element.
|
String |
getNamespaceURI(String prefix)
Returns the URI of the namespace that has the given prefix.
|
Node |
getNextSibling() |
Object |
getObjectValue() |
ParameterMetaData |
getParamMetaData() |
Node |
getPreviousSibling() |
TypeInfo |
getSchemaTypeInfo() |
String |
getTagName() |
String |
getValue()
Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise.
|
Iterator<String> |
getVisibleNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings visible to this element.
|
XMLFragment |
getXMLFragment()
Get the payload as source.
|
QName |
getXmlType() |
boolean |
hasAttribute(String name) |
boolean |
hasAttributeNS(String namespaceURI,
String localName) |
boolean |
hasAttributes() |
boolean |
hasChildNodes() |
boolean |
removeAttribute(Name name)
Removes the attribute with the specified name.
|
void |
removeAttribute(String name) |
Attr |
removeAttributeNode(Attr oldAttr) |
void |
removeAttributeNS(String namespaceURI,
String localName) |
Node |
removeChild(Node oldChild) |
void |
removeContents()
Detaches all children of this SOAPElement.
|
boolean |
removeNamespaceDeclaration(String prefix)
Removes the namespace declaration corresponding to the given prefix.
|
Node |
replaceChild(Node newChild,
Node oldChild) |
void |
setAttribute(String name,
String value) |
Attr |
setAttributeNode(Attr newAttr) |
Attr |
setAttributeNodeNS(Attr newAttr) |
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String value) |
void |
setIdAttribute(String name,
boolean isId) |
void |
setIdAttributeNode(Attr idAttr,
boolean isId) |
void |
setIdAttributeNS(String namespaceURI,
String localName,
boolean isId) |
void |
setObjectValue(Object objValue) |
void |
setParamMetaData(ParameterMetaData paramMetaData) |
void |
setValue(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.
|
void |
setXMLFragment(XMLFragment xmlFragment) |
protected SOAPContent.State |
transitionTo(SOAPContent.State nextState) |
void |
writeElement(Writer writer)
The default implementation uses a DOMWriter.
|
addAttribute, addChildElement, createQName, getAllAttributesAsQNames, getAttributeValue, getChildElements, getElementQName, getFirstChildElementByLocalName, getSOAPEnvelope, removeAttribute, setElementQName, setElementQNameInternal, setEncodingStyle, setPrefix, writeElementContent
compareDocumentPosition, detachNode, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getTextContent, getUserData, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, setNodeValue, setParentElement, setTextContent, setUserData, toString
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
detachNode, getParentElement, recycleNode, setParentElement
compareDocumentPosition, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getTextContent, getUserData, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, setNodeValue, setTextContent, setUserData
public static final QName GENERIC_PARAM_NAME
public static final QName GENERIC_RETURN_NAME
protected SOAPContent soapContent
public SOAPContentElement(Name name)
public SOAPContentElement(QName qname)
public SOAPContentElement(SOAPElementImpl element)
public ParameterMetaData getParamMetaData()
public void setParamMetaData(ParameterMetaData paramMetaData)
public QName getXmlType()
public Class getJavaType()
protected SOAPContent.State transitionTo(SOAPContent.State nextState)
public XMLFragment getXMLFragment()
getXMLFragment
in interface SOAPContentAccess
public void setXMLFragment(XMLFragment xmlFragment)
setXMLFragment
in interface SOAPContentAccess
public Object getObjectValue()
getObjectValue
in interface SOAPContentAccess
public void setObjectValue(Object objValue)
setObjectValue
in interface SOAPContentAccess
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
child
- the SOAPElement to be added as a new childSOAPException
- if there was an error in adding this
element as a childpublic SOAPElement addChildElement(String localName, String prefix) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
localName
- a String giving the local name for the new elementprefix
- a String giving the namespace prefix for the new elementSOAPException
- if the prefix
is not valid in the
context of this SOAPElement
or if there is an error in creating the
SOAPElement
objectpublic SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
localName
- a String giving the local name for the new elementprefix
- a String giving the namespace prefix for the new elementuri
- a String giving the URI of the namespace to which the new element belongsSOAPException
- if there is an error in creating the
SOAPElement
objectpublic SOAPElement addChildElement(Name name) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
name
- a Name object with the XML name for the new elementSOAPException
- if there is an error in creating the
SOAPElement
objectSOAPElement.addChildElement(javax.xml.namespace.QName)
public SOAPElement addChildElement(String name) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPElementImpl
name
- a String giving the local name for the elementSOAPException
- if there is an error in creating the
SOAPElement
objectpublic SOAPElement addTextNode(String value) throws SOAPException
SOAPElementImpl
addTextNode
in interface SOAPElement
addTextNode
in class SOAPElementImpl
value
- a String object with the textual content to be addedSOAPException
- if there is an error in creating the
new Text
object or if it is not legal to
attach it as a child to this
SOAPElement
public Iterator<Node> getChildElements()
SOAPElementImpl
getChildElements
in interface SOAPElement
getChildElements
in class SOAPElementImpl
public Iterator<SOAPElement> getChildElements(Name name)
SOAPElementImpl
getChildElements
in interface SOAPElement
getChildElements
in class SOAPElementImpl
name
- a Name object with the name of the child elements to be returnedSOAPElement.getChildElements(javax.xml.namespace.QName)
public void removeContents()
SOAPElementImpl
removeContents
in interface SOAPElement
removeContents
in class SOAPElementImpl
public Iterator<Name> getAllAttributes()
SOAPElementImpl
getAllAttributes
in interface SOAPElement
getAllAttributes
in class SOAPElementImpl
SOAPElement.getAllAttributesAsQNames()
public String getAttribute(String name)
getAttribute
in interface Element
getAttribute
in class SOAPElementImpl
public Attr getAttributeNode(String name)
getAttributeNode
in interface Element
getAttributeNode
in class SOAPElementImpl
public Attr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNodeNS
in interface Element
getAttributeNodeNS
in class SOAPElementImpl
public String getAttributeNS(String namespaceURI, String localName)
getAttributeNS
in interface Element
getAttributeNS
in class SOAPElementImpl
public String getAttributeValue(Name name)
SOAPElementImpl
getAttributeValue
in interface SOAPElement
getAttributeValue
in class SOAPElementImpl
name
- a Name object with the name of the attributeSOAPElement.getAttributeValue(javax.xml.namespace.QName)
public SOAPElement addAttribute(Name name, String value) throws SOAPException
SOAPElementImpl
addAttribute
in interface SOAPElement
addAttribute
in class SOAPElementImpl
name
- a Name object with the name of the attributevalue
- a String giving the value of the attributeSOAPException
- if there is an error in creating the
Attribute, or it is invalid to set
an attribute with Name
name
on this SOAPElement.SOAPElement.addAttribute(javax.xml.namespace.QName, String)
public SOAPElement addNamespaceDeclaration(String prefix, String nsURI)
SOAPElementImpl
addNamespaceDeclaration
in interface SOAPElement
addNamespaceDeclaration
in class SOAPElementImpl
prefix
- a String giving the prefix of the namespacensURI
- a String giving the uri of the namespacepublic Name getElementName()
SOAPElementImpl
getElementName
in interface SOAPElement
getElementName
in class SOAPElementImpl
public NodeList getElementsByTagName(String name)
getElementsByTagName
in interface Element
getElementsByTagName
in class SOAPElementImpl
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS
in interface Element
getElementsByTagNameNS
in class SOAPElementImpl
public String getEncodingStyle()
SOAPElementImpl
getEncodingStyle
in interface SOAPElement
getEncodingStyle
in class SOAPElementImpl
SOAPElement.setEncodingStyle(java.lang.String)
public Iterator<String> getNamespacePrefixes()
SOAPElementImpl
getNamespacePrefixes
in interface SOAPElement
getNamespacePrefixes
in class SOAPElementImpl
public String getNamespaceURI(String prefix)
SOAPElementImpl
getNamespaceURI
in interface SOAPElement
getNamespaceURI
in class SOAPElementImpl
prefix
- a String giving the prefix of the namespace for which to searchpublic TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface Element
getSchemaTypeInfo
in class SOAPElementImpl
public String getTagName()
getTagName
in interface Element
getTagName
in class SOAPElementImpl
public Iterator<String> getVisibleNamespacePrefixes()
SOAPElementImpl
getVisibleNamespacePrefixes
in interface SOAPElement
getVisibleNamespacePrefixes
in class SOAPElementImpl
public boolean hasAttribute(String name)
hasAttribute
in interface Element
hasAttribute
in class SOAPElementImpl
public boolean hasAttributeNS(String namespaceURI, String localName)
hasAttributeNS
in interface Element
hasAttributeNS
in class SOAPElementImpl
public boolean removeAttribute(Name name)
SOAPElementImpl
removeAttribute
in interface SOAPElement
removeAttribute
in class SOAPElementImpl
name
- the Name object with the name of the attribute to be removedSOAPElement.removeAttribute(javax.xml.namespace.QName)
public void removeAttribute(String name) throws DOMException
removeAttribute
in interface Element
removeAttribute
in class SOAPElementImpl
DOMException
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
removeAttributeNode
in interface Element
removeAttributeNode
in class SOAPElementImpl
DOMException
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
removeAttributeNS
in interface Element
removeAttributeNS
in class SOAPElementImpl
DOMException
public boolean removeNamespaceDeclaration(String prefix)
SOAPElementImpl
removeNamespaceDeclaration
in interface SOAPElement
removeNamespaceDeclaration
in class SOAPElementImpl
prefix
- a String giving the prefix for which to searchpublic void setAttribute(String name, String value) throws DOMException
setAttribute
in interface Element
setAttribute
in class SOAPElementImpl
DOMException
public Attr setAttributeNode(Attr newAttr) throws DOMException
setAttributeNode
in interface Element
setAttributeNode
in class SOAPElementImpl
DOMException
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
setAttributeNodeNS
in interface Element
setAttributeNodeNS
in class SOAPElementImpl
DOMException
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
setAttributeNS
in interface Element
setAttributeNS
in class SOAPElementImpl
DOMException
public void setIdAttribute(String name, boolean isId) throws DOMException
setIdAttribute
in interface Element
setIdAttribute
in class SOAPElementImpl
DOMException
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
setIdAttributeNode
in interface Element
setIdAttributeNode
in class SOAPElementImpl
DOMException
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
setIdAttributeNS
in interface Element
setIdAttributeNS
in class SOAPElementImpl
DOMException
public Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
appendChild
in class NodeImpl
DOMException
public Node cloneNode(boolean deep)
public NodeList getChildNodes()
getChildNodes
in interface Node
getChildNodes
in class NodeImpl
public Node getFirstChild()
getFirstChild
in interface Node
getFirstChild
in class NodeImpl
public Node getLastChild()
getLastChild
in interface Node
getLastChild
in class NodeImpl
public String getValue()
NodeImpl
public boolean hasChildNodes()
hasChildNodes
in interface Node
hasChildNodes
in class NodeImpl
public Node removeChild(Node oldChild) throws DOMException
removeChild
in interface Node
removeChild
in class NodeImpl
DOMException
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
replaceChild
in class NodeImpl
DOMException
public void setValue(String value)
NodeImpl
public NamedNodeMap getAttributes()
getAttributes
in interface Node
getAttributes
in class NodeImpl
public boolean hasAttributes()
hasAttributes
in interface Node
hasAttributes
in class NodeImpl
public Node getPreviousSibling()
getPreviousSibling
in interface Node
getPreviousSibling
in class NodeImpl
public Node getNextSibling()
getNextSibling
in interface Node
getNextSibling
in class NodeImpl
public void writeElement(Writer writer) throws IOException
SOAPElementImpl
writeElement
in class SOAPElementImpl
IOException
public void accept(SAAJVisitor visitor)
Copyright © 2018 JBoss by Red Hat. All rights reserved.