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:

  • factoryClass and factoryMethod define the class containing a no-argument method for creating an instance of this class as the equivalent of an empty XML element.
  • The attribute name provides the XML schema name if you don't want to use the class name.
  • The namespace attribute provides the name of the target namespace.
  • The string array value defined by propOrder establishes 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 titleitems and cluster should appear in the given order:

@XmlRootElement
@XmlType( propOrder={ "title", "items", "cluster" } )
public class Document {
...
}

JAXB - Annotations, Annotation for Classes: XmlType的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. JAXB - Annotations, Type Mapping: XmlSchemaType

    The annotation XmlSchemaType defines a mapping between an arbitrary Java type and a simple schema bu ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. MVC Razor 语法(转)

    http://blog.csdn.net/pasic/article/details/7072340 原文地址:MVC Razor 语法(转)作者:panzhaowen_jacki 语法名称 Razo ...

  2. Java修饰符关键词大全

    所以我以此主题写了这篇文章.这也是一个可用于测试你的计算机科学知识的面试问题. Java修饰符是你添加到变量.类和方法以改变其含义的关键词.它们可分为两组: 访问控制修饰符 非访问修饰符 让我们先来看 ...

  3. excel 的一些操作

    unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...

  4. [iOS基础控件 - 6.0] UITableView

    A.需要掌握的 1.基本属性和方法 设置UITableView的dataSource.delegate UITableView多组数据和单组数据的展示 UITableViewCell的常见属性 UIT ...

  5. iOS 详解NSXMLParser方法解析XML数据方法

    前一篇文章已经介绍了如何通过URL从网络上获取xml数据.下面介绍如何将获取到的数据进行解析. 下面先看看xml的数据格式吧! <?xml version="1.0" enc ...

  6. iOS开发—字典转模型,KVC设计模式

    iOS开发UI基础—字典转模型 开发中,通常使用第三方框架可以很快的实现通过字典转模型,通过plist创建模型,将字典的键值对转成模型属性,将模型转成字典,通过模型数组来创建一个字典数组,通过字典数组 ...

  7. css中文字体unicode对照表

    为什么要使用Unicode编码代替中文字体 在CSS中使用中文字体通常直接设置字体名称,比如设置字体为宋体:font-family:’宋体’:但因此产生的一个问题是,如果默认编码并不是UTF-8,这会 ...

  8. Linux下修改Oracle监听地址

    如果你的服务器换了ip怎么办? 如果你的服务器换了名字怎么办? 以前的小伙伴怎么办? 以前的老客户怎么办? 没关系,简单教你修改监听地址,老朋友随便找! 想要修改监听地址首先要找到两个文件,确定两样东 ...

  9. Young不等式的一个新证明

    设 $p>0,q>0,a>0,b>0$ 且 $1/p+1/q=1$ 有 \[ab\leq \frac{a^{p}}{p}+\frac{b^{q}}{q}\] 证明:设 \[f( ...

  10. NYOJ109 数列转换 【守恒法】

    数列转换 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描写叙述 有一个数列a1,a2,a3...an,每次能够从中随意选三个相邻的数ai-1 ,ai , ai+1 ,进行例 ...