XmlJavaTypeAdapter (Java EE 5 SDK)

Java

Java EE 5 SDK

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


javax.xml.bind.annotation.adapters Annotation Type XmlJavaTypeAdapter


@Retention(value=RUNTIME)
@Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
public @interface XmlJavaTypeAdapter

Use an adapter that implements XmlAdapter for custom marshaling.

Usage:

The @XmlJavaTypeAdapter annotation can be used with the following program elements:

When @XmlJavaTypeAdapter annotation is defined on a class, it applies to all references to the class.

When @XmlJavaTypeAdapter annotation is defined at the package level it applies to all references from within the package to @XmlJavaTypeAdapter.type().

When @XmlJavaTypeAdapter annotation is defined on the field, property or parameter, then the annotation applies to the field, property or the parameter only.

A @XmlJavaTypeAdapter annotation on a field, property or parameter overrides the @XmlJavaTypeAdapter annotation associated with the class being referenced by the field, property or parameter.

A @XmlJavaTypeAdapter annotation on a class overrides the @XmlJavaTypeAdapter annotation specified at the package level for that class.

This annotation can be used with the following other annotations: XmlElement, XmlAttribute, XmlElementRef, XmlElementRefs, XmlAnyElement. This can also be used at the package level with the following annotations: XmlAccessorType, XmlSchema, XmlSchemaType, XmlSchemaTypes.

Example: See example in XmlAdapter

从以下版本开始:
JAXB2.0
版本:
$Revision: 1.10 $
作者:
  • Sekhar Vajjhala, Sun Microsystems Inc.
  • Kohsuke Kawaguchi, Sun Microsystems Inc.
另请参见:
XmlAdapter

Required Element Summary
 Class<? extends XmlAdapter> value
          Points to the clsss that converts a value type to a bound type or vice versa.
 
Optional Element Summary
 Class type
          If this annotation is used at the package level, then value of the type() must be specified.
 

元素详细信息

value

public abstract Class<? extends XmlAdapter> value
Points to the clsss that converts a value type to a bound type or vice versa. See XmlAdapter for more details.

type

public abstract Class type
If this annotation is used at the package level, then value of the type() must be specified.

默认值:
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT.class

Java EE 5 SDK

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


提交错误或意见

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