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, writePayloadToprotected 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 Messagepublic Source readEnvelopeAsSource()
MessageSource object.readEnvelopeAsSource in class Messagepublic <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException
MessagereadPayloadAsJAXB in class MessageJAXBException - If JAXB reports an error during the processing.public <T> T readPayloadAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge)
throws JAXBException
MessageBridge.
This consumes the message.readPayloadAsJAXB in class MessageJAXBException - If JAXB reports an error during the processing.public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException
MessagereadPayloadAsJAXB in class MessageJAXBException - 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 Messagejavax.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 MessagecontentHandler - 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. SAXExceptions thrown
from ErrorHandler should propagate directly through this method.SAXExceptionprotected 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.SAXExceptionpublic Message toSAAJ(Packet p, Boolean inbound) throws javax.xml.soap.SOAPException
javax.xml.soap.SOAPExceptionpublic javax.xml.soap.SOAPMessage readAsSOAPMessage() throws javax.xml.soap.SOAPException
writeTo(ContentHandler, ErrorHandler)readAsSOAPMessage in class Messagejavax.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
MessageSOAPMessage 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 Messagejavax.xml.soap.SOAPException - if there's any error while creating a SOAPMessage.public MessageHeaders getMessageHeaders()
getMessageHeaders in class MessageCopyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.