Interface TypeMapping


  • public interface TypeMapping
    The javax.xml.rpc.encoding.TypeMapping is the base interface for the representation of a type mapping. A TypeMapping implementation class may support one or more encoding styles.

    For its supported encoding styles, a TypeMapping instance maintains a set of tuples of the type {Java type, SerializerFactory, DeserializerFactory, XML type}.

    Version:
    $Rev: 467553 $ $Date: 2006-10-25 00:01:51 -0400 (Wed, 25 Oct 2006) $
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DeserializerFactory getDeserializer​(java.lang.Class javaType, javax.xml.namespace.QName xmlType)
      Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.
      SerializerFactory getSerializer​(java.lang.Class javaType, javax.xml.namespace.QName xmlType)
      Gets the SerializerFactory registered for the specified pair of Java type and XML data type.
      java.lang.String[] getSupportedEncodings()
      Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
      boolean isRegistered​(java.lang.Class javaType, javax.xml.namespace.QName xmlType)
      Checks whether or not type mapping between specified XML type and Java type is registered.
      void register​(java.lang.Class javaType, javax.xml.namespace.QName xmlType, SerializerFactory sf, DeserializerFactory dsf)
      Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type.
      void removeDeserializer​(java.lang.Class javaType, javax.xml.namespace.QName xmlType)
      Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.
      void removeSerializer​(java.lang.Class javaType, javax.xml.namespace.QName xmlType)
      Removes the SerializerFactory registered for the specified pair of Java type and XML data type.
      void setSupportedEncodings​(java.lang.String[] encodingStyleURIs)
      Sets the encodingStyle URIs supported by this TypeMapping instance.
    • Method Detail

      • getSupportedEncodings

        java.lang.String[] getSupportedEncodings()
        Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance. A TypeMapping that contains only encoding style independent serializers and deserializers returns null from this method.
        Returns:
        Array of encodingStyle URIs for the supported encoding styles
      • setSupportedEncodings

        void setSupportedEncodings​(java.lang.String[] encodingStyleURIs)
        Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding independent serializers and deserializers requires null as the parameter for this method.
        Parameters:
        encodingStyleURIs - Array of encodingStyle URIs for the supported encoding styles
      • isRegistered

        boolean isRegistered​(java.lang.Class javaType,
                             javax.xml.namespace.QName xmlType)
        Checks whether or not type mapping between specified XML type and Java type is registered.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        Returns:
        boolean; true if type mapping between the specified XML type and Java type is registered; otherwise false
      • register

        void register​(java.lang.Class javaType,
                      javax.xml.namespace.QName xmlType,
                      SerializerFactory sf,
                      DeserializerFactory dsf)
        Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type. This method replaces any existing registered SerializerFactory DeserializerFactory instances.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        sf - SerializerFactory
        dsf - DeserializerFactory
        Throws:
        JAXRPCException - if there are any errors that prevent registration
      • getSerializer

        SerializerFactory getSerializer​(java.lang.Class javaType,
                                        javax.xml.namespace.QName xmlType)
        Gets the SerializerFactory registered for the specified pair of Java type and XML data type.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        Returns:
        Registered SerializerFactory or null if there is no registered factory
      • getDeserializer

        DeserializerFactory getDeserializer​(java.lang.Class javaType,
                                            javax.xml.namespace.QName xmlType)
        Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        Returns:
        Registered SerializerFactory or null if there is no registered factory
      • removeSerializer

        void removeSerializer​(java.lang.Class javaType,
                              javax.xml.namespace.QName xmlType)
        Removes the SerializerFactory registered for the specified pair of Java type and XML data type.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        Throws:
        JAXRPCException - if there is any error that prevents removal of the registered SerializerFactory
      • removeDeserializer

        void removeDeserializer​(java.lang.Class javaType,
                                javax.xml.namespace.QName xmlType)
        Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.
        Parameters:
        javaType - Class of the Java type
        xmlType - Qualified name of the XML data type
        Throws:
        JAXRPCException - if there is any error in removing the registered DeserializerFactory