TypeMapping (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.xml.rpc.encoding 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}.

版本:
1.0
作者:
Rahul Sharma

方法摘要
 DeserializerFactory getDeserializer(Class javaType, QName xmlType)
          Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.
 SerializerFactory getSerializer(Class javaType, QName xmlType)
          Gets the SerializerFactory registered for the specified pair of Java type and XML data type.
 String[] getSupportedEncodings()
          Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
 boolean isRegistered(Class javaType, QName xmlType)
          Checks whether or not type mapping between specified XML type and Java type is registered.
 void register(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf)
          Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type.
 void removeDeserializer(Class javaType, QName xmlType)
          Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.
 void removeSerializer(Class javaType, QName xmlType)
          Removes the SerializerFactory registered for the specified pair of Java type and XML data type.
 void setSupportedEncodings(String[] encodingStyleURIs)
          Sets the encodingStyle URIs supported by this TypeMapping instance.
 

方法详细信息

getSupportedEncodings

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.

返回:
Array of encodingStyle URIs for the supported encoding styles

setSupportedEncodings

void setSupportedEncodings(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.

参数:
encodingStyleURIs - Array of encodingStyle URIs for the supported encoding styles

isRegistered

boolean isRegistered(Class javaType,
                     QName xmlType)
Checks whether or not type mapping between specified XML type and Java type is registered.

参数:
javaType - Class of the Java type
QName - Qualified name of the XML data type
返回:
boolean; true if type mapping between the specified XML type and Java type is registered; otherwise false

register

void register(Class javaType,
              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.

参数:
javaType - Class of the Java type
QName - Qualified name of the XML data type
sf - SerializerFactory
dsf - DeserializerFactory
抛出异常:
JAXRPCException - If any error during the registration

getSerializer

SerializerFactory getSerializer(Class javaType,
                                QName xmlType)
Gets the SerializerFactory registered for the specified pair of Java type and XML data type.

参数:
javaType - Class of the Java type
QName - Qualified name of the XML data type
返回:
Registered SerializerFactory or null if there is no registered factory

getDeserializer

DeserializerFactory getDeserializer(Class javaType,
                                    QName xmlType)
Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.

参数:
javaType - Class of the Java type
QName - Qualified name of the XML data type
返回:
Registered DeserializerFactory or null if there is no registered factory

removeSerializer

void removeSerializer(Class javaType,
                      QName xmlType)
Removes the SerializerFactory registered for the specified pair of Java type and XML data type.

抛出异常:
JAXRPCException - If there is error in removing the registered SerializerFactory

removeDeserializer

void removeDeserializer(Class javaType,
                        QName xmlType)
Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.

抛出异常:
JAXRPCException - If there is error in removing the registered DeserializerFactory

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.