JAXB - Annotations, Annotation for Classes: XmlType
This annotation adds information that would be available from a schema type, but isn't implied by a Java class declaration. The annotation has several attributes:
factoryClassandfactoryMethoddefine the class containing a no-argument method for creating an instance of this class as the equivalent of an empty XML element.- The attribute
nameprovides the XML schema name if you don't want to use the class name. - The
namespaceattribute provides the name of the target namespace. - The string array value defined by
propOrderestablishes an ordering of the sub-elements. (It's pretty obvious that there can't be a connection between the textual order of items in a class definition and the order its fields are returned by reflection methods.)
Here is an example for XmlType, requesting that the elements title, items and cluster should appear in the given order:
@XmlRootElement
@XmlType( propOrder={ "title", "items", "cluster" } )
public class Document {
...
}
JAXB - Annotations, Annotation for Classes: XmlType的更多相关文章
- JAXB - Annotations, The Annotation XmlElement
The basic annotation for a field that's intended to be an element is XmlElement. It permits you to d ...
- JAXB - Annotations, Controlling Element Selection: XmlAccessorType, XmlTransient
If JAXB binds a class to XML, then, by default, all public members will be bound, i.e., public gette ...
- JAXB - Annotations, Top-level Elements: XmlRootElement
A class that describes an XML element that is to be a top-level element, i.e., one that can function ...
- JAXB - Annotations, Type Adapters: XmlJavaTypeAdapter
For some Java container types JAXB has no built-in mapping to an XML structure. Also, you may want t ...
- JAXB - Annotations, Type Mapping: XmlSchemaType
The annotation XmlSchemaType defines a mapping between an arbitrary Java type and a simple schema bu ...
- JAXB - Annotations, Annotations for the Schema: XmlSchema
This annotation can only be used with a package. It defines parameters that are derived from the xsd ...
- JAXB - Annotations, The Object Factory: XmlRegistry, XmlElementDecl
To be able to create objects from XML elements, the unmarshaller must have an object factory with me ...
- JAXB - Annotations, Class Fields as Attributes: XmlAttribute
Provided that XML lets you represent a data item as a single value, there is no cut-and-dried rule f ...
- JAXB - Annotations, Annotations for Enums: XmlEnum, XmlEnumValue
An enum type is annotated with XmlEnum. It has an optional element value of type java.lang.Class whi ...
随机推荐
- Redhat常见问题
1.现象:hadoop用户启动startx时失败,报如下提示 Fatal server error: PAM authentication failed, cannot start X server. ...
- Android--应用开发2(AndroidManfest.xml)
AndroidManfest.xml 文件分析 manifest 根节点,描述package中所有内容 xmlns:android 包含命名空间声明.xmlns:android="http: ...
- 图解Java字符串不变性
1. 声明字符串 String s = "abcd"; 这里,s存储了“abcd”在这个字符串对象的引用,如下图所示: 2. 将字符串变量s赋值给字符串变量s2 String s2 ...
- 软件工程 --- Pair Project: Elevator Scheduler [电梯调度算法的实现和测试]
软件工程 --- Pair Project: Elevator Scheduler [电梯调度算法的实现和测试] 说明结对编程的优点和缺点. 结对编程的优点如下: 在独立设计.实现代码的过程中不 ...
- 最简单的计算MD5方法
原来写过一个计算MD5的程序,是用了一个叫MD5.pas的单元,使用起来还算简单,但还有更简单的办法,安装了indy就会有IdHashMessageDigest单元(delphi 7默认安装indy) ...
- ALM11需求和测试覆盖率图解1
覆盖率分析视图 需求覆盖率选项卡
- 转载 ASP.NET常用的正则表达式
转载原地址: http://www.cnblogs.com/0001/archive/2010/01/26/1656677.html 常用表达式: "^\d+$" //非负整数(正 ...
- hdu1863 畅通工程(最小生成树之prim)
Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).经过调查评估,得到的统计表中列出了有可 ...
- python os.path模块--转载
os.path.abspath(path) #返回绝对路径 os.path.basename(path) #返回文件名 os.path.commonprefix(list) #返回list(多个路径) ...
- PING命令入门详解(转载)
本文转自http://www.linkwan.com/gb/tech/htm/928.htm 1.Ping的基础知识 ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是 ...