Package com.sun.xml.ws.message
Class AbstractMessageImpl
java.lang.Object
com.sun.xml.ws.api.message.Message
com.sun.xml.ws.message.AbstractMessageImpl
- Direct Known Subclasses:
DOMMessage,EmptyMessageImpl,JAXBDispatchMessage,JAXBMessage,PayloadStreamReaderMessage,StreamMessage,VerifiedStreamMessage,XMLMessage.UnknownContent,XMLMessage.XMLMultiPart
Partial
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.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TagInfosetprotected static final List<TagInfoset>protected static final AttributesImplprotected TagInfosetprotected TagInfosetprotected static final LocatorImplprotected final SOAPVersionSOAP version of this message.Fields inherited from class com.sun.xml.ws.api.message.Message
attachmentSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMessageImpl(SOAPVersion soapVersion) protectedCopy constructor. -
Method Summary
Modifier and TypeMethodDescriptionjavax.xml.soap.SOAPMessageDefault implementation that useswriteTo(ContentHandler, ErrorHandler)javax.xml.soap.SOAPMessagereadAsSOAPMessage(Packet packet, boolean inbound) Creates the equivalentSOAPMessagefrom this message.Consumes this message including the envelope.<T> TreadPayloadAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge) Deprecated.<T> TreadPayloadAsJAXB(XMLBridge<T> bridge) Reads the payload as a Data-Bond object This consumes the message.<T> TreadPayloadAsJAXB(javax.xml.bind.Unmarshaller unmarshaller) Reads the payload as a JAXB object by using the given unmarshaller.protected abstract voidwritePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) Writes the payload to SAX events.voidDefault implementation that relies onMessage.writePayloadTo(XMLStreamWriter)voidwriteTo(ContentHandler contentHandler, ErrorHandler errorHandler) Writes the whole envelope as SAX events.voidMethods inherited from class com.sun.xml.ws.api.message.Message
addSOAPMimeHeaders, assertOneWay, consume, copy, copyFrom, generateMessageID, getAttachments, getFirstDetailEntryName, getHeaders, getID, getID, getMethod, getOperation, getOperation, getPayloadLocalPart, getPayloadNamespaceURI, getTransportHeaders, getTransportHeaders, hasAttachments, hasHeaders, hasPayload, isFault, isOneWay, readPayload, readPayloadAsSource, setMessageMedadata, writePayloadTo
-
Field Details
-
soapVersion
SOAP version of this message. Used to implement some of the methods, but nothing more than that.So if you aren't using those methods that use this field, this can be null.
-
envelopeTag
-
headerTag
-
bodyTag
-
EMPTY_ATTS
-
NULL_LOCATOR
-
DEFAULT_TAGS
-
-
Constructor Details
-
AbstractMessageImpl
-
AbstractMessageImpl
Copy constructor.
-
-
Method Details
-
getSOAPVersion
- Overrides:
getSOAPVersionin classMessage
-
readEnvelopeAsSource
Description copied from class:MessageConsumes this message including the envelope. returns it as aSourceobject.- Specified by:
readEnvelopeAsSourcein classMessage
-
readPayloadAsJAXB
public <T> T readPayloadAsJAXB(javax.xml.bind.Unmarshaller unmarshaller) throws javax.xml.bind.JAXBException Description copied from class:MessageReads the payload as a JAXB object by using the given unmarshaller. This consumes the message.- Specified by:
readPayloadAsJAXBin classMessage- Throws:
javax.xml.bind.JAXBException- If JAXB reports an error during the processing.
-
readPayloadAsJAXB
public <T> T readPayloadAsJAXB(com.sun.xml.bind.api.Bridge<T> bridge) throws javax.xml.bind.JAXBException Deprecated.Description copied from class:MessageReads the payload as a JAXB object according to the givenBridge. This consumes the message.- Specified by:
readPayloadAsJAXBin classMessage- Returns:
- null if there's no payload.
- Throws:
javax.xml.bind.JAXBException- If JAXB reports an error during the processing.
-
readPayloadAsJAXB
Description copied from class:MessageReads the payload as a Data-Bond object This consumes the message.- Specified by:
readPayloadAsJAXBin classMessage- Returns:
- null if there's no payload.
- Throws:
javax.xml.bind.JAXBException- If JAXB reports an error during the processing.
-
writeToBodyStart
- Throws:
XMLStreamException
-
writeTo
Default implementation that relies onMessage.writePayloadTo(XMLStreamWriter)- Specified by:
writeToin classMessage- Throws:
XMLStreamException- If theXMLStreamWriterreports an error, or some other errors happen during the processing.
-
writeTo
Writes the whole envelope as SAX events.- Specified by:
writeToin classMessage- Parameters:
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 asSAXParseException.SAXExceptions thrown fromErrorHandlershould propagate directly through this method.- Throws:
SAXException
-
writePayloadTo
protected abstract void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException Writes the payload to SAX events.- Parameters:
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.- Throws:
SAXException
-
toSAAJ
- Throws:
javax.xml.soap.SOAPException
-
readAsSOAPMessage
public javax.xml.soap.SOAPMessage readAsSOAPMessage() throws javax.xml.soap.SOAPExceptionDefault implementation that useswriteTo(ContentHandler, ErrorHandler)- Specified by:
readAsSOAPMessagein classMessage- Throws:
javax.xml.soap.SOAPException- if there's any error while creating aSOAPMessage.
-
readAsSOAPMessage
public javax.xml.soap.SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws javax.xml.soap.SOAPException Description copied from class:MessageCreates the equivalentSOAPMessagefrom this message. It also uses transport specific headers from Packet during the SOAPMessage construction so thatSOAPMessage.getMimeHeaders()gives meaningful transport headers. This consumes the message.- Overrides:
readAsSOAPMessagein classMessage- Throws:
javax.xml.soap.SOAPException- if there's any error while creating aSOAPMessage.
-