client.java

来自「weblogic_src_xml.rar」· Java 代码 · 共 38 行

JAVA
38
字号
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 + =
减小字号Ctrl + -
显示快捷键?