⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 java 的关于web serive教程
💻 JAVA
字号:
/* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.io.FileInputStream;import java.io.IOException;import java.math.BigDecimal;import javax.xml.bind.JAXBContext;import javax.xml.bind.JAXBException;import javax.xml.bind.Marshaller;import javax.xml.bind.Unmarshaller;import java.util.List;// import java content classes generated by binding compilerimport example.*;/* * $Id: Main.java,v 1.1 2006/01/25 20:16:02 jendrock Exp $ * * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. *  * This software is the proprietary information of Sun Microsystems, Inc.   * Use is subject to license terms. *  */ public class Main {        // This sample application demonstrates how to modify a collection    // in a java content tree and marshal it back to xml data        public static void main( String[] args ) {        try {            // create a JAXBContext capable of handling classes generated into            // the example package            JAXBContext jc = JAXBContext.newInstance( "example" );                        // create an Unmarshaller            Unmarshaller u = jc.createUnmarshaller();                        // unmarshal a FooBar instance document into a tree of Java content            // objects composed of classes from the example package.            Object fbe =  u.unmarshal( new FileInputStream( "example.xml" ) );            // create a Marshaller and marshal to a file            Marshaller m = jc.createMarshaller();            m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );            m.marshal( fbe, System.out );                    } catch( JAXBException je ) {            je.printStackTrace();        } catch( IOException ioe ) {            ioe.printStackTrace();        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -