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 ...
随机推荐
- C语言简短程序gcc编译过程
一.建立一个×.c源文件.这里起名:rocks.c 二.编辑源代码,在c源文件内输入如下代码: #include <stdio.h> int main() { puts("C R ...
- HLA中常用的基本术语
(1)联邦(Federation):用于实现某一特定仿真目的的分布仿真系统. (2)联邦成员(Federate):参与联邦的所有应用都称为联邦成员,简称成员. (3)对象(Object):构成成员的基 ...
- HDU-4705 Y 树形DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4705 题意:给一颗树,从树上任意选择3个点{A,B,C},要求他们不在一条链上,求总共的数目. 容易想 ...
- acm-字符串整理
一.后缀数组 #define maxn 200015 int wa[maxn],wb[maxn],wv[maxn],WS[maxn]; int len, sa[maxn] ; inline void ...
- IOS成长之路-调用照相机和相册功能
打开相机: //先设定sourceType为相机,然后判断相机是否可用(ipod)没相机,不可用将sourceType设定为相片库 UIImagePickerControllerSourceType ...
- [OC Foundation框架 - 6] NSMutableString
NSString是不可变的 NSMutableString是可变字符串 1.初始化 2.串联字符串 3.替换字符串 4.插入字符串 5.删除字符串 #pragma mark buffer st ...
- Oracle- 包
在一个大型项目中,可能有很多模块,而每个模块又有自己的过程.函数等.而这些过程.函数默认是放在一起的(如在PL/SQL中,过程默认都是放在一起的,即Procedures中),这些非常不方便查询和维护. ...
- DataTable 基本转换简单实例
var query = from dt in tblProduct.AsEnumerable() where dt.Field<string>("StockNo") = ...
- SQLite 使用教程2 语法
http://www.runoob.com/sqlite/sqlite-syntax.html SQLite 语法 SQLite 是遵循一套独特的称为语法的规则和准则.本教程列出了所有基本的 SQLi ...
- 解决 mac ssh空闲 连接断开问题
想必大家都知道,用终端 ssh 连接服务器,如果长时间没有操作,会被断开连接. 要用的话又得重新登录,这非常不方便,也影响开发效率.那针对这种情况,有没有解决方法呢? 答案是肯定的.理论上,有两种方案 ...