public abstract class AbstractMessageImpl extends Message
Message
implementation.
This class implements some of the Message
methods.
The idea is that those implementations may be non-optimal but
it may save effort in implementing Message
and reduce
the code size.
Message
classes that are used more commonly should
examine carefully which method can be implemented faster,
and override them accordingly.
Modifier and Type | Field and Description |
---|---|
protected static AttributesImpl |
EMPTY_ATTS |
protected static LocatorImpl |
NULL_LOCATOR |
protected SOAPVersion |
soapVersion
SOAP version of this message.
|
attachmentSet
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageImpl(AbstractMessageImpl that)
Copy constructor.
|
protected |
AbstractMessageImpl(SOAPVersion soapVersion) |
Modifier and Type | Method and Description |
---|---|
MessageHeaders |
getMessageHeaders()
Default implementation of getMessageHeaders just calls getHeaders()
for now.
|
SOAPVersion |
getSOAPVersion() |
javax.xml.soap.SOAPMessage |
readAsSOAPMessage()
Default implementation that uses
writeTo(ContentHandler, ErrorHandler) |
javax.xml.soap.SOAPMessage |
readAsSOAPMessage(Packet packet,
boolean inbound)
Creates the equivalent
SOAPMessage from this message. |
Source |
readEnvelopeAsSource()
Consumes this message including the envelope.
|
<T> T |
readPayloadAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge)
Deprecated.
|
<T> T |
readPayloadAsJAXB(Unmarshaller unmarshaller)
Reads the payload as a JAXB object by using the given unmarshaller.
|
<T> T |
readPayloadAsJAXB(XMLBridge<T> bridge)
Reads the payload as a Data-Bond object
This consumes the message.
|
Message |
toSAAJ(Packet p,
Boolean inbound) |
protected abstract void |
writePayloadTo(ContentHandler contentHandler,
ErrorHandler errorHandler,
boolean fragment)
Writes the payload to SAX events.
|
void |
writeTo(ContentHandler contentHandler,
ErrorHandler errorHandler)
Writes the whole envelope as SAX events.
|
void |
writeTo(javax.xml.stream.XMLStreamWriter w)
Default implementation that relies on
Message.writePayloadTo(XMLStreamWriter) |
addSOAPMimeHeaders, assertOneWay, consume, copy, generateMessageID, getAttachments, getFirstDetailEntryName, getHeaders, getID, getID, getMethod, getOperation, getOperation, getPayloadLocalPart, getPayloadNamespaceURI, getTransportHeaders, getTransportHeaders, hasAttachments, hasHeaders, hasPayload, isFault, isOneWay, readPayload, readPayloadAsSource, writePayloadTo
protected final SOAPVersion soapVersion
So if you aren't using those methods that use this field, this can be null.
protected static final AttributesImpl EMPTY_ATTS
protected static final LocatorImpl NULL_LOCATOR
protected AbstractMessageImpl(SOAPVersion soapVersion)
protected AbstractMessageImpl(AbstractMessageImpl that)
public SOAPVersion getSOAPVersion()
getSOAPVersion
in class Message
public Source readEnvelopeAsSource()
Message
Source
object.readEnvelopeAsSource
in class Message
public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException
Message
readPayloadAsJAXB
in class Message
JAXBException
- If JAXB reports an error during the processing.public <T> T readPayloadAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge) throws JAXBException
Message
Bridge
.
This consumes the message.readPayloadAsJAXB
in class Message
JAXBException
- If JAXB reports an error during the processing.public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException
Message
readPayloadAsJAXB
in class Message
JAXBException
- If JAXB reports an error during the processing.public void writeTo(javax.xml.stream.XMLStreamWriter w) throws javax.xml.stream.XMLStreamException
Message.writePayloadTo(XMLStreamWriter)
writeTo
in class Message
javax.xml.stream.XMLStreamException
- If the XMLStreamWriter
reports an error,
or some other errors happen during the processing.public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException
writeTo
in class Message
contentHandler
- must not be nulll.errorHandler
- must not be null.
any error encountered during the SAX event production must be
first reported to this error handler. Fatal errors can be then
thrown as SAXParseException
. SAXException
s thrown
from ErrorHandler
should propagate directly through this method.SAXException
protected abstract void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException
fragment
- if true, this method will fire SAX events without start/endDocument events,
suitable for embedding this into a bigger SAX event sequence.
if false, this method generaets a completely SAX event sequence on its own.SAXException
public Message toSAAJ(Packet p, Boolean inbound) throws javax.xml.soap.SOAPException
javax.xml.soap.SOAPException
public javax.xml.soap.SOAPMessage readAsSOAPMessage() throws javax.xml.soap.SOAPException
writeTo(ContentHandler, ErrorHandler)
readAsSOAPMessage
in class Message
javax.xml.soap.SOAPException
- if there's any error while creating a SOAPMessage
.public javax.xml.soap.SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws javax.xml.soap.SOAPException
Message
SOAPMessage
from this message. It also uses
transport specific headers from Packet during the SOAPMessage construction
so that SOAPMessage.getMimeHeaders()
gives meaningful transport
headers.
This consumes the message.readAsSOAPMessage
in class Message
javax.xml.soap.SOAPException
- if there's any error while creating a SOAPMessage
.public MessageHeaders getMessageHeaders()
getMessageHeaders
in class Message
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.