JAXB - XML Schema Types, Binary Data
Data that has no "natural" representation with printable characters must, for inclusion in an XML file, still be represented in printable characters. The simple technique for this consists in converting the binary byte values to their hexadecimal representations. The XML Schema datatype to use in this case is xsd:hexBinary
. A sample schema declaration is shown below.
<xsd:complexType name="BinaryType">
<xsd:sequence>
<xsd:element name="data" type="xsd:hexBinary"/>
</xsd:sequence>
</xsd:complexType>
The Java class produced by JAXB contains a convenient pair of getter and setter methods for accessing the instance variable (called data
) that stores the binary data. Its type and the type for passing the binary data is byte[]
. All conversions are handled by JAXB.
public class BinaryType { protected byte[] data; public byte[] getData() {
return data;
} public void setData(byte[] value) {
this.data = ((byte[]) value);
}
}
JAXB - XML Schema Types, Binary Data的更多相关文章
- JAXB - XML Schema Types, Date and Time
JAXB binds all three of the schema types xsd:date, xsd:time and xsd:dateTime to XMLGregorianCalendar ...
- JAXB - XML Schema Types, Defining Subtypes
Although object orientation isn't a key feature of XML or the XML Schema language, it's still possib ...
- JAXB - XML Schema Types, Defining an Enumeration
If you want a data type that enumerates discrete values you should use a restriction of the schema t ...
- JAXB - XML Schema Types, Defining Types for XML Elements With Content
Content: A Value The content of an XML element may be some value, or one or more subordinate element ...
- JAXB - XML Schema Types, Defining Types for XML Elements Without Content
Types for XML elements are constructed using xsd:complexType, even if they do not have content. The ...
- XML Schema and XMLspy notes
Introduction An xml documents consists of elements, attributes and text. There are two structures in ...
- 【转】XSD (xml Schema Definition)
来自:http://www.cnblogs.com/newsouls/archive/2011/10/28/2227765.html Xml Schema的用途 1. 定义一个Xml文档中都有什么元 ...
- [BTS] System.Xml.Schema.XmlSchemaException: The complexType has already been declared when generate IDoc schema.
I use wcf-sap adapter for generate the schema of IDoc that named "YHREMPMASTER". but throw ...
- Xml Schema的用途
Xml Schema的用途 1. 定义一个Xml文档中都有什么元素 2. 定义一个Xml文档中都会有什么属性 3. 定义某个节点的都有什么样的子节点,可以有多少个子节点,子节点出现的顺序 4. ...
随机推荐
- 【Linux 命令】Linux系统下强制用户下线——who,pkill
[日期]2014年11月18日 [平台]Centos 6.5 [工具]who pkill [步骤] 1)准备工作 以root身份登录. 2)执行who命令,查看有哪些用户已登录到当前主机
- HW6.3
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- eclipse配置struts.xml自动提示
a)window – preferences – xml - xml catalog –> add b)选择key type为URI c)key: http://struts.apache.o ...
- delphi -- 进制转换 函数表
1.16 TO 10 ******************************************************** 16转10,否则输出-1 function Hex(c: cha ...
- SQL2008-截取字段函数
ltrim() int转字符 Left('ABC',2)='AB' right('ABC',2)='BC' SUBSTRING('ABC',1,2)='AB' 和DELPHI中的COPY一样Sub ...
- Dijkstra in python
下面是一段由python实现的Dijkstra算法,一些地方的处理实在非常棒,相比于C,代码的数量已经缩减到了60行,所以我想通过本文简单的介绍一下这段代码的细节之处,首先给出源程序: from sy ...
- Android 添加、移除和判断 桌面快捷方式图标
思路: Launcher为了应用程序能够定制自己的快捷图标,就注册了一个 BroadcastReceiver 专门接收其他应用程序发来的快捷图标定制信息.所以只需要根据该 BroadcastRecei ...
- Oracle- 查询误删数据
使用flashback table能恢复误删数据. flashback table CONTAINER_CONTENT to timestamp to_timestamp('2010-06-30 22 ...
- MySql实现远程连接
MySql实现远程连接 1.进入mysql,创建一个新用户root,密码为root: 格式:grant 权限 on 数据库名.表名 to 用户@登录主机 identified by "用户密 ...
- Volley使用指南第一回(来自developer.android)
最近闲来想看看android网络方面的东西.google在2013年发布了一个叫做Volley的网络请求框架,我看了一下官网,居然在training里面就有教程.首先,英文的东西看着 还是挺不爽的,特 ...