Class HeaderImpl
- java.lang.Object
-
- com.sun.xml.messaging.saaj.soap.impl.ElementImpl
-
- com.sun.xml.messaging.saaj.soap.impl.HeaderImpl
-
- All Implemented Interfaces:
Node,SOAPBodyElement,SOAPElement,SOAPHeader,Element,Node
- Direct Known Subclasses:
Header1_1Impl,Header1_2Impl
public abstract class HeaderImpl extends ElementImpl implements SOAPHeader
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanMUST_UNDERSTAND_ONLY-
Fields inherited from class com.sun.xml.messaging.saaj.soap.impl.ElementImpl
DSIG_NS, elementQName, WSU_NS, XENC_NS
-
Fields inherited from interface org.w3c.dom.Node
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 Summary
Constructors Modifier Constructor Description protectedHeaderImpl(SOAPDocumentImpl ownerDoc, NameImpl name)protectedHeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SOAPElementaddChildElement(String localName)Creates a newSOAPElementobject initialized with the specified local name and adds the new element to thisSOAPElementobject.protected SOAPElementaddElement(Name name)protected SOAPElementaddElement(QName name)SOAPHeaderElementaddHeaderElement(Name name)Creates a newSOAPHeaderElementobject initialized with the specified name and adds it to thisSOAPHeaderobject.SOAPHeaderElementaddHeaderElement(QName name)Creates a newSOAPHeaderElementobject initialized with the specified qname and adds it to thisSOAPHeaderobject.SOAPHeaderElementaddUpgradeHeaderElement(String supportedSoapUri)Creates a new UpgradeSOAPHeaderElementobject initialized with the specified supported SOAP URI and adds it to thisSOAPHeaderobject.SOAPHeaderElementaddUpgradeHeaderElement(String[] supportedSoapUris)Creates a new UpgradeSOAPHeaderElementobject initialized with the specified array of supported SOAP URIs and adds it to thisSOAPHeaderobject.SOAPHeaderElementaddUpgradeHeaderElement(Iterator<String> supportedSoapUris)Creates a new UpgradeSOAPHeaderElementobject initialized with the specified List of supported SOAP URIs and adds it to thisSOAPHeaderobject.protected SOAPElementconvertToSoapElement(Element element)protected abstract SOAPHeaderElementcreateHeaderElement(Name name)protected abstract SOAPHeaderElementcreateHeaderElement(QName name)Iterator<SOAPHeaderElement>examineAllHeaderElements()Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.Iterator<SOAPHeaderElement>examineHeaderElements(String actor)Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor.Iterator<SOAPHeaderElement>examineMustUnderstandHeaderElements(String actor)Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue.Iterator<SOAPHeaderElement>extractAllHeaderElements()Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject and detaches them from thisSOAPHeaderobject.Iterator<SOAPHeaderElement>extractHeaderElements(String actor)Returns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor and detaches them from thisSOAPHeaderobject.protected Iterator<SOAPHeaderElement>getHeaderElements(String actor, boolean detach, boolean mustUnderstand)protected Iterator<SOAPHeaderElement>getHeaderElementsForActor(String actor, boolean detach, boolean mustUnderstand)protected abstract NameImplgetNotUnderstoodName()protected abstract NameImplgetSupportedEnvelopeName()protected abstract NameImplgetUpgradeName()SOAPElementsetElementQName(QName newName)Changes the name of thisElementtonewNameif possible.voidsetParentElement(SOAPElement element)Sets the parent of thisNodeobject to the givenSOAPElementobject.-
Methods inherited from class com.sun.xml.messaging.saaj.soap.impl.ElementImpl
addAttribute, addAttribute, addCDATA, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addNode, addText, addTextNode, appendChild, cloneNode, compareDocumentPosition, convertToSoapText, createElement, createElement, createQName, detachNode, doGetNamespacePrefixes, ensureNamespaceIsDeclared, findAndConvertChildElement, findChild, findEncodingStyleAttributeName, getAllAttributes, getAllAttributesAsQNames, getAllAttributesFrom, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getAttributeValue, getAttributeValueFrom, getBaseURI, getChildElementNodes, getChildElements, getChildElements, getChildElements, getChildElementsFrom, getChildNodes, getDomElement, getElementName, getElementQName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFeature, getFirstChild, getLastChild, getLocalName, getLocalPart, getNamespaceAttr, getNamespaceAttrFrom, getNamespaceContextNodes, getNamespaceContextNodes, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPrefix, getPreviousSibling, getQualifiedName, getSchemaTypeInfo, getSoapDocument, getSOAPNamespace, getTagName, getTextContent, getUserData, getValue, getValueNode, getValueNodeStrict, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, importElement, insertBefore, isDefaultNamespace, isEqualNode, isNamespaceQualified, isNamespaceQualified, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeAttribute, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeContents, removeNamespaceDeclaration, replaceChild, replaceElementWithSOAPElement, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setEncodingStyle, setEncodingStyleNamespace, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, setValue, tryToFindEncodingStyleAttributeName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from interface jakarta.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setValue
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, 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 jakarta.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
-
Methods inherited from interface jakarta.xml.soap.SOAPHeader
addNotUnderstoodHeaderElement
-
-
-
-
Field Detail
-
MUST_UNDERSTAND_ONLY
protected static final boolean MUST_UNDERSTAND_ONLY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HeaderImpl
protected HeaderImpl(SOAPDocumentImpl ownerDoc, NameImpl name)
-
HeaderImpl
protected HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement)
-
-
Method Detail
-
createHeaderElement
protected abstract SOAPHeaderElement createHeaderElement(Name name) throws SOAPException
- Throws:
SOAPException
-
createHeaderElement
protected abstract SOAPHeaderElement createHeaderElement(QName name) throws SOAPException
- Throws:
SOAPException
-
getNotUnderstoodName
protected abstract NameImpl getNotUnderstoodName()
-
getUpgradeName
protected abstract NameImpl getUpgradeName()
-
getSupportedEnvelopeName
protected abstract NameImpl getSupportedEnvelopeName()
-
addHeaderElement
public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
Description copied from interface:SOAPHeaderCreates a newSOAPHeaderElementobject initialized with the specified name and adds it to thisSOAPHeaderobject.- Specified by:
addHeaderElementin interfaceSOAPHeader- Parameters:
name- aNameobject with the name of the newSOAPHeaderElementobject- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs- See Also:
SOAPHeader.addHeaderElement(javax.xml.namespace.QName)
-
addHeaderElement
public SOAPHeaderElement addHeaderElement(QName name) throws SOAPException
Description copied from interface:SOAPHeaderCreates a newSOAPHeaderElementobject initialized with the specified qname and adds it to thisSOAPHeaderobject.- Specified by:
addHeaderElementin interfaceSOAPHeader- Parameters:
name- aQNameobject with the qname of the newSOAPHeaderElementobject- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs- See Also:
SOAPHeader.addHeaderElement(Name)
-
addElement
protected SOAPElement addElement(Name name) throws SOAPException
- Overrides:
addElementin classElementImpl- Throws:
SOAPException
-
addElement
protected SOAPElement addElement(QName name) throws SOAPException
- Overrides:
addElementin classElementImpl- Throws:
SOAPException
-
examineHeaderElements
public Iterator<SOAPHeaderElement> examineHeaderElements(String actor)
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor. An actor is a global attribute that indicates the intermediate parties that should process a message before it reaches its ultimate receiver. An actor receives the message and processes it before sending it on to the next actor. The default actor is the ultimate intended recipient for the message, so if no actor attribute is included in aSOAPHeaderobject, it is sent to the ultimate receiver along with the message body.In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.
- Specified by:
examineHeaderElementsin interfaceSOAPHeader- Parameters:
actor- aStringgiving the URI of theactor/rolefor which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specifiedactor/role - See Also:
SOAPHeader.extractHeaderElements(java.lang.String),SOAPConstants.URI_SOAP_ACTOR_NEXT
-
extractHeaderElements
public Iterator<SOAPHeaderElement> extractHeaderElements(String actor)
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor and detaches them from thisSOAPHeaderobject.This method allows an actor to process the parts of the
SOAPHeaderobject that apply to it and to remove them before passing the message on to the next actor.In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.
- Specified by:
extractHeaderElementsin interfaceSOAPHeader- Parameters:
actor- aStringgiving the URI of theactor/rolefor which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specifiedactor/role - See Also:
SOAPHeader.examineHeaderElements(java.lang.String),SOAPConstants.URI_SOAP_ACTOR_NEXT
-
getHeaderElementsForActor
protected Iterator<SOAPHeaderElement> getHeaderElementsForActor(String actor, boolean detach, boolean mustUnderstand)
-
getHeaderElements
protected Iterator<SOAPHeaderElement> getHeaderElements(String actor, boolean detach, boolean mustUnderstand)
-
setParentElement
public void setParentElement(SOAPElement element) throws SOAPException
Description copied from interface:NodeSets the parent of thisNodeobject to the givenSOAPElementobject.- Specified by:
setParentElementin interfaceNode- Overrides:
setParentElementin classElementImpl- Parameters:
element- theSOAPElementobject to be set as the parent of thisNodeobject- Throws:
SOAPException- if there is a problem in setting the parent to the given element- See Also:
Node.getParentElement()
-
addChildElement
public SOAPElement addChildElement(String localName) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the specified local name and adds the new element to thisSOAPElementobject. The newSOAPElementinherits any in-scope default namespace.- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classElementImpl- Parameters:
localName- aStringgiving the local name for the element- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if there is an error in creating theSOAPElementobject
-
examineAllHeaderElements
public Iterator<SOAPHeaderElement> examineAllHeaderElements()
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject.- Specified by:
examineAllHeaderElementsin interfaceSOAPHeader- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader - See Also:
SOAPHeader.extractAllHeaderElements()
-
examineMustUnderstandHeaderElements
public Iterator<SOAPHeaderElement> examineMustUnderstandHeaderElements(String actor)
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject that have the specified actor and that have a MustUnderstand attribute whose value is equivalent totrue.In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.
- Specified by:
examineMustUnderstandHeaderElementsin interfaceSOAPHeader- Parameters:
actor- aStringgiving the URI of theactor/rolefor which to search- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects that contain the specifiedactor/roleand are marked as MustUnderstand - See Also:
SOAPHeader.examineHeaderElements(java.lang.String),SOAPHeader.extractHeaderElements(java.lang.String),SOAPConstants.URI_SOAP_ACTOR_NEXT
-
extractAllHeaderElements
public Iterator<SOAPHeaderElement> extractAllHeaderElements()
Description copied from interface:SOAPHeaderReturns anIteratorover all theSOAPHeaderElementobjects in thisSOAPHeaderobject and detaches them from thisSOAPHeaderobject.- Specified by:
extractAllHeaderElementsin interfaceSOAPHeader- Returns:
- an
Iteratorobject over all theSOAPHeaderElementobjects contained by thisSOAPHeader - See Also:
SOAPHeader.examineAllHeaderElements()
-
addUpgradeHeaderElement
public SOAPHeaderElement addUpgradeHeaderElement(Iterator<String> supportedSoapUris) throws SOAPException
Description copied from interface:SOAPHeaderCreates a new UpgradeSOAPHeaderElementobject initialized with the specified List of supported SOAP URIs and adds it to thisSOAPHeaderobject. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.- Specified by:
addUpgradeHeaderElementin interfaceSOAPHeader- Parameters:
supportedSoapUris- anIteratorobject with the URIs of SOAP versions supported.- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs.
-
addUpgradeHeaderElement
public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri) throws SOAPException
Description copied from interface:SOAPHeaderCreates a new UpgradeSOAPHeaderElementobject initialized with the specified supported SOAP URI and adds it to thisSOAPHeaderobject. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.- Specified by:
addUpgradeHeaderElementin interfaceSOAPHeader- Parameters:
supportedSoapUri- the URI of SOAP the version that is supported.- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs.
-
addUpgradeHeaderElement
public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) throws SOAPException
Description copied from interface:SOAPHeaderCreates a new UpgradeSOAPHeaderElementobject initialized with the specified array of supported SOAP URIs and adds it to thisSOAPHeaderobject. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.- Specified by:
addUpgradeHeaderElementin interfaceSOAPHeader- Parameters:
supportedSoapUris- an array of the URIs of SOAP versions supported.- Returns:
- the new
SOAPHeaderElementobject that was inserted into thisSOAPHeaderobject - Throws:
SOAPException- if a SOAP error occurs.
-
convertToSoapElement
protected SOAPElement convertToSoapElement(Element element)
- Overrides:
convertToSoapElementin classElementImpl
-
setElementQName
public SOAPElement setElementQName(QName newName) throws SOAPException
Description copied from interface:SOAPElementChanges the name of thisElementtonewNameif possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the
SOAPElementto a renamed instance.- Specified by:
setElementQNamein interfaceSOAPElement- Overrides:
setElementQNamein classElementImpl- Parameters:
newName- the new name for theElement.- Returns:
- The renamed Node
- Throws:
SOAPException- if changing the name of thisElementis not allowed.
-
-