下载此文档

castor简介(castor简介).doc


文档分类:办公文档 | 页数:约24页 举报非法文档有奖
1/24
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/24 下载此文档
文档列表 文档介绍
castor简介(castor简介)
What is 1. Castor?
Castor is an open source software that automatically binds Java objects to XML. It can be bound between Java objects, XML text, SQL data tables, and LDAP directories
Castor XML is an XML databinding framework. Unlike the two main XML APIs DOM (Document Object Model) and SAX (Simple API for XML which with the structure) deal of an XML document, Castor enables one to deal with the data defined in an XML document through an object model which represents that data.
Castor can convert Java objects to XML documents, freeing users plex XML parsing, and focusing more on data rather than documents.
Castor web site: /
2 Castor usage
The Java object refers to a setX and getX method JavaBean,
Castor JavaBean for the use of specific methods are as follows
Usage: default default usage refers to no use mapping format description file when usage
Standard usage: Standard usage refers to the use of the mapping file format description.
In fact, Castor not only can be used for the JavaBean class. It can also be accessed with a public member variable simple data object class data. For example, slightly modifying the aforementioned Test class, you can use the following definition of flight data, and eventually get the same XML format:
Public class FlightData {public String carrier; public int number; public String departure; public String arrival;}
In order to make the Castor work, a class must all adopt this way or that way. If the class defines any getX or setX method, Castor treats it as bean, and only uses these methods in marshalling and reconciliation groups
3 the format of XML under default usage
< XML version= encoding=UTF-8? >
<arrival-time>8:42a</arrival-time>
<departure-time>6:23</departure-time>
<carrier>AR</carrier>
In other words
An attribute that creates elements for attributes with basic type values (in this case, only the number attribute is declared as int by the getNumber () method. For each attribute with an

castor简介(castor简介) 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数24
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rjmy2261
  • 文件大小26 KB
  • 时间2017-11-13