TypeMapping (Java EE 5)

Java EE API


javax.xml.rpc.encoding Interface TypeMapping


public interface TypeMapping


javax.xml.rpc.encoding.TypeMapping 是用于类型映射表示形式的基本接口。TypeMapping 实现类可以支持一个或多个编码样式。

对于支持的编码样式,TypeMapping 实例维护一个类型元组集{Java 类型, SerializerFactory, DeserializerFactory, XML 类型}。

英文文档:

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:
1.0
Author:
Rahul Sharma

Method Summary
 DeserializerFactory
 SerializerFactory
 String[]
 boolean
 void
 void
 void
 void
 

Method Detail

public String[] getSupportedEncodings()
返回此 TypeMapping 实例支持的 encodingStyle URI(String[] 形式)。仅包含独立于编码样式的 Serializer 和 Deserializer 的 TypeMapping 从此方法返回 null
return 受支持编码样式的 encodingStyle URI 所组成的数组
英文文档:

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.

Returns:
Array of encodingStyle URIs for the supported encoding styles

public void setSupportedEncodings(String[] encodingStyleURIs)
设置此 TypeMapping 实例支持的 encodingStyle URI。仅包含独立于编码的 Serializer 和 Deserializer 的 TypeMapping 要求使用 null 作为此方法的参数。
encodingStyleURIs 受支持编码样式的 encodingStyle URI 所组成的数组
英文文档:

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.

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

public boolean isRegistered(Class<T> javaType, javax.xml.namespace.QName xmlType)
检查是否注册了指定 XML 类型与 Java 类型之间的类型映射。
javaType Java 类型的类
QName XML 数据类型的限定名称
return 一个 boolean 值,如果注册了指定 XML 类型与 Java 类型之间的类型映射,则返回 true;否则返回 false
英文文档:

isRegistered

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

Parameters:
javaType - Class of the Java type
QName - 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

public void register(Class<T> javaType, javax.xml.namespace.QName xmlType, SerializerFactory sf, DeserializerFactory dsf)
注册用于 XML 类型与 Java 类型之间的特定类型映射的 SerializerFactory 和 DeserializerFactory。此方法将替换任何现有的已注册 SerializerFactory DeserializerFactory 实例。
javaType Java 类型的类
QName XML 数据类型的限定名称
sf
SerializerFactory
dsf
DeserializerFactory
ThrowsJAXRPCException: 如果注册期间发生错误
英文文档:

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.

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
sf - SerializerFactory
dsf - DeserializerFactory
Throws:
JAXRPCException - If any error during the registration

public SerializerFactory getSerializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
获取已针对指定的 Java 类型和 XML 数据类型对注册的 SerializerFactory。
javaType Java 类型的类
QName XML 数据类型的限定名称
return 已注册的 SerializerFactory;如果没有任何已注册的工厂,则返回 null
英文文档:

getSerializer

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

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
Returns:
Registered SerializerFactory or null if there is no registered factory

public DeserializerFactory getDeserializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
获取已针对指定的 Java 类型和 XML 数据类型对注册的 DeserializerFactory。
javaType Java 类型的类
QName XML 数据类型的限定名称
return 已注册的 DeserializerFactory;如果没有任何已注册的工厂,则返回 null
英文文档:

getDeserializer

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

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
Returns:
Registered DeserializerFactory or null if there is no registered factory

public void removeSerializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
移除已针对指定的 Java 类型和 XML 数据类型对注册的 SerializerFactory。
ThrowsJAXRPCException: 如果在移除已注册 SerializerFactory 的过程中出现错误
英文文档:

removeSerializer

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

Throws:
JAXRPCException - If there is error in removing the registered SerializerFactory

public void removeDeserializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
移除已针对指定的 Java 类型和 XML 数据类型类注册的 DeserializerFactory。
ThrowsJAXRPCException: 如果在移除已注册 DeserializerFactory 的过程中出现错误
英文文档:

removeDeserializer

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

Throws:
JAXRPCException - If there is error in removing the registered DeserializerFactory


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!