XML绑定框架 JBind

码农软件 · 软件分类 · WEB服务/SOAP/SOA · 2019-04-10 06:59:17

软件介绍

JBind 框架根据XML Schema生成 Java 绑定代码,构建前端访问存储在XML文档里的数据。

示例代码

package org.jbind.example.meansOfTransport;

import org.jbind.xml.core.data.IDataContext;
import org.jbind.xml.instance.builder.DataContext;
import org.jbind.xml.facade.JBindFacade;
import org.jbind.xml.msg.XmlException;
import java.util.Iterator;

public class Main {
public static void main(String[] args) {
// Create a shared data context
IDataContext context = new DataContext(true);
try {
// Read manufacturers
JBindFacade.unmarshal(Main.class.getResource("manufacturers.xml"), context);
// Read means of transports
IMeansOfTransportsData data = (IMeansOfTransportsData)
JBindFacade.unmarshal(Main.class.getResource("meansOfTransports.xml"), context);
for (Iterator i = data.iterMeansOfTransports(); i.hasNext(); ) {
IMeansOfTransport mot = (IMeansOfTransport)i.next();
IManufacturerData man = mot.refManufacturer();
System.out.println("MeansOfTransport was manufactured by: " + man.getName());
}
} catch (XmlException e) {
e.printStackTrace();
System.exit(-1);
}
System.exit(0);
}
}

本文地址:https://codercto.com/soft/d/3248.html

Ajax Design Patterns

Ajax Design Patterns

Michael Mahemoff / O'Reilly Media / 2006-06-29 / USD 44.99

Ajax, or Asynchronous JavaScript and XML, exploded onto the scene in the spring of 2005 and remains the hottest story among web developers. With its rich combination of technologies, Ajax provides a s......一起来看看 《Ajax Design Patterns》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具