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

Hadoop in Action

Hadoop in Action

Chuck Lam / Manning Publications / 2010-12-22 / USD 44.99

HIGHLIGHT Hadoop in Action is an example-rich tutorial that shows developers how to implement data-intensive distributed computing using Hadoop and the Map- Reduce framework. DESCRIPTION Hadoop i......一起来看看 《Hadoop in Action》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试