Class VersionTransformer


  • public class VersionTransformer
    extends org.apache.cxf.ws.addressing.VersionTransformer
    This class is responsible for transforming between the native WS-Addressing schema version (i.e. 2005/08) and exposed version (currently may be 2005/08 or 2004/08).

    The native version is that used throughout the stack, were the WS-A types are represented via the JAXB generated types for the 2005/08 schema.

    The exposed version is that used when the WS-A types are externalized, i.e. are encoded in the headers of outgoing messages. For outgoing requests, the exposed version is determined from configuration. For outgoing responses, the exposed version is determined by the exposed version of the corresponding request.

    The motivation for using different native and exposed types is usually to facilitate a WS-* standard based on an earlier version of WS-Adressing (for example WS-RM depends on the 2004/08 version).

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.cxf.ws.addressing.VersionTransformer

        org.apache.cxf.ws.addressing.VersionTransformer.Names200403, org.apache.cxf.ws.addressing.VersionTransformer.Names200408
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected MAPCodec codec  
      static Set<QName> HEADERS  
      • Fields inherited from class org.apache.cxf.ws.addressing.VersionTransformer

        NATIVE_VERSION
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T decodeAsNative​(String encodedAs, Class<T> clz, Element headerElement, javax.xml.bind.Unmarshaller unmarshaller)
      Decodes a MAP from a exposed version.
      <T> void encodeAsExposed​(org.apache.cxf.binding.soap.SoapMessage message, String exposeAs, T value, String localName, Class<T> clz, javax.xml.bind.JAXBContext marshaller, boolean mustUnderstand)
      Encode message in exposed version.
      • Methods inherited from class org.apache.cxf.ws.addressing.VersionTransformer

        convert, convert, convert, convert, convert, convert, convert, convert, convert, convert, convert, convertTo200403, convertTo200403, convertTo200403, convertToNative, getExposedJAXBContext, getExposedReferenceType, isSupported, parseEndpointReference
    • Constructor Detail

      • VersionTransformer

        public VersionTransformer​(MAPCodec mapCodec)
        Constructor.
        Parameters:
        mapCodec - the MAPCodec to use
    • Method Detail

      • encodeAsExposed

        public <T> void encodeAsExposed​(org.apache.cxf.binding.soap.SoapMessage message,
                                        String exposeAs,
                                        T value,
                                        String localName,
                                        Class<T> clz,
                                        javax.xml.bind.JAXBContext marshaller,
                                        boolean mustUnderstand)
                                 throws javax.xml.bind.JAXBException
        Encode message in exposed version.
        Parameters:
        message - The message to be encoded
        exposeAs - specifies the WS-Addressing version to expose
        value - the value to encode
        localName - the localName for the header
        clz - the class
        marshaller - the JAXB context to use
        mustUnderstand - whether mustUnderstand is true
        Throws:
        javax.xml.bind.JAXBException
      • decodeAsNative

        public <T> T decodeAsNative​(String encodedAs,
                                    Class<T> clz,
                                    Element headerElement,
                                    javax.xml.bind.Unmarshaller unmarshaller)
                             throws javax.xml.bind.JAXBException
        Decodes a MAP from a exposed version.
        Parameters:
        encodedAs - specifies the encoded version
        clz - the class
        headerElement - the SOAP header element
        unmarshaller - the JAXB unmarshaller to use
        Returns:
        the decoded value
        Throws:
        javax.xml.bind.JAXBException