|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.ws.message.AbstractHeaderImpl
com.sun.xml.ws.message.StringHeader
public class StringHeader
Header
that has a single text value in it
(IOW, of the form <foo>text</foo>.)
Field Summary | |
---|---|
protected static String |
MUST_UNDERSTAND
|
protected boolean |
mustUnderstand
|
protected QName |
name
Tag name. |
protected static String |
S11_MUST_UNDERSTAND_TRUE
|
protected static String |
S12_MUST_UNDERSTAND_TRUE
|
protected SOAPVersion |
soapVersion
|
protected String |
value
Header value. |
Fields inherited from class com.sun.xml.ws.message.AbstractHeaderImpl |
---|
EMPTY_ATTS |
Constructor Summary | |
---|---|
StringHeader(QName name,
String value)
|
|
StringHeader(QName name,
String value,
SOAPVersion soapVersion,
boolean mustUnderstand)
|
Method Summary | |
---|---|
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. |
XMLStreamReader |
readHeader()
Reads the header as a XMLStreamReader . |
void |
writeTo(ContentHandler h,
ErrorHandler errorHandler)
Writes out the header as SAX events. |
void |
writeTo(SOAPMessage saaj)
Writes out the header to the given SOAPMessage. |
void |
writeTo(XMLStreamWriter w)
Writes out the header as a fragment. |
Methods inherited from class com.sun.xml.ws.message.AbstractHeaderImpl |
---|
getAttribute, getRole, getStringContent, isIgnorable, isRelay, parseBool, readAsEPR, readAsJAXB, readAsJAXB, readAsJAXB, readAsJAXB |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final QName name
protected final String value
protected boolean mustUnderstand
protected SOAPVersion soapVersion
protected static final String MUST_UNDERSTAND
protected static final String S12_MUST_UNDERSTAND_TRUE
protected static final String S11_MUST_UNDERSTAND_TRUE
Constructor Detail |
---|
public StringHeader(@NotNull QName name, @NotNull String value)
public StringHeader(@NotNull QName name, @NotNull String value, @NotNull SOAPVersion soapVersion, boolean mustUnderstand)
Method Detail |
---|
@NotNull public String getNamespaceURI()
Header
@NotNull public String getLocalPart()
Header
@Nullable public String getAttribute(@NotNull String nsUri, @NotNull 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 XMLStreamReader readHeader() throws 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.
XMLStreamException
public void writeTo(XMLStreamWriter w) throws XMLStreamException
Header
XMLStreamException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public void writeTo(SOAPMessage saaj) throws SOAPException
Header
Sometimes a Message
needs to produce itself
as SOAPMessage
, in which case each header needs
to turn itself into a header.
SOAPException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public void writeTo(ContentHandler h, 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
.
h
- The ContentHandler
that receives SAX events.errorHandler
- The ErrorHandler
that receives parsing errors.
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |