public class DOMHeader<N extends Element> extends AbstractHeaderImpl
Header
implementation for a DOM.Modifier and Type | Field and Description |
---|---|
protected N |
node |
EMPTY_ATTS
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAttribute(String nsUri,
String localName)
Gets the attribute value on the header element.
|
String |
getLocalPart()
Gets the local name of this header element.
|
String |
getNamespaceURI()
Gets the namespace URI of this header element.
|
String |
getStringContent()
Used to obtain value XYZ from a header that looks like
"<header>XYZ</header>".
|
N |
getWrappedNode() |
int |
hashCode() |
<T> T |
readAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge)
Deprecated.
|
<T> T |
readAsJAXB(Unmarshaller unmarshaller)
Reads the header as a JAXB object by using the given unmarshaller.
|
javax.xml.stream.XMLStreamReader |
readHeader()
Reads the header as a
XMLStreamReader . |
void |
writeTo(ContentHandler contentHandler,
ErrorHandler errorHandler)
Writes out the header as SAX events.
|
void |
writeTo(javax.xml.soap.SOAPMessage saaj)
Writes out the header to the given SOAPMessage.
|
void |
writeTo(javax.xml.stream.XMLStreamWriter w)
Writes out the header as a fragment.
|
getAttribute, getRole, isIgnorable, isRelay, parseBool, readAsEPR, readAsJAXB, readAsJAXB
public DOMHeader(N node)
public String getNamespaceURI()
Header
public String getLocalPart()
Header
public javax.xml.stream.XMLStreamReader readHeader() throws javax.xml.stream.XMLStreamException
Header
XMLStreamReader
.
The returned parser points at the start element of this header.
(IOW, XMLStreamReader.getEventType()
would return
XMLStreamConstants.START_ELEMENT
.
For some Header
implementations, this operation
is a non-trivial operation. Therefore, use of this method
is discouraged unless the caller is interested in reading
the whole header.
Similarly, if the caller wants to use this method only to do
the API conversion (such as simply firing SAX events from
XMLStreamReader
), then the JAX-WS team requests
that you talk to us.
Message
s that come from tranport usually provides
a reasonably efficient implementation of this method.
javax.xml.stream.XMLStreamException
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException
Header
readAsJAXB
in interface Header
readAsJAXB
in class AbstractHeaderImpl
JAXBException
public <T> T readAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge) throws JAXBException
Header
readAsJAXB
in interface Header
readAsJAXB
in class AbstractHeaderImpl
JAXBException
public void writeTo(javax.xml.stream.XMLStreamWriter w) throws javax.xml.stream.XMLStreamException
Header
javax.xml.stream.XMLStreamException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException
Header
Sometimes a Message
needs to produce SAX events,
and this method is necessary for headers to participate to it.
A header is responsible for producing the SAX events for its part, including startPrefixMapping and endPrefixMapping, but not startDocument/endDocument.
Note that SAX contract requires that any error that does NOT originate
from ContentHandler
(meaning any parsing error and etc) must
be first reported to ErrorHandler
. If the SAX event production
cannot be continued and the processing needs to abort, the code may
then throw the same SAXParseException
reported to ErrorHandler
.
contentHandler
- The ContentHandler
that receives SAX events.errorHandler
- The ErrorHandler
that receives parsing errors.SAXException
public String getAttribute(String nsUri, String localName)
Header
nsUri
- The namespace URI of the attribute. Can be empty.localName
- The local name of the attribute.Header
implementation
doesn't have to do anything.public void writeTo(javax.xml.soap.SOAPMessage saaj) throws javax.xml.soap.SOAPException
Header
Sometimes a Message
needs to produce itself
as SOAPMessage
, in which case each header needs
to turn itself into a header.
javax.xml.soap.SOAPException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public String getStringContent()
Header
getStringContent
in interface Header
getStringContent
in class AbstractHeaderImpl
public N getWrappedNode()
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.