📄 client.java
字号:
package examples.xml.orderParser;
/**
* Initiates the parsing of an XML document into
* business objects using the XMLInputStream API.
*
* @author Copyright (c) 2003 by BEA Systems, Inc. All Rights Reserved.
*/
public class Client {
/**
* Run this Client from the command line.
* <p>
* The Client expects one argument: the name of the XML file to be parsed.
* The Client looks for the XML file in the current directory.
* <p>
* To run the client, enter this command at the command line:
* <tt>java examples.xml.orderParser.Client filename.xml</tt>
*/
public static void main(String[] args) {
// Validate params
if (args.length < 1) {
System.out.println("Usage: java examples.xml.orderParser.Client filename.xml");
} else {
StreamParser sp = new StreamParser();
try {
// Get inputsteam and pass for processing.
sp.parse(sp.getInputStream(args[0]));
// Print resulting order business object.
sp.getOrderBO().printOrder();
System.out.println("Successfully handled the document");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -