예제 #1
0
  /** Start the DTD parsing (called by GenBeans class) */
  public void process() throws java.io.IOException, Schema2BeansException {
    if (this.filename == null && this.schemaIn == null)
      throw new IllegalArgumentException(Common.getMessage("FilenameNotSpecified_msg", errHeader));

    if (this.handler == null)
      throw new IllegalArgumentException(Common.getMessage("HandlerNotSpecified_msg", errHeader));

    if (config.isTraceParse()) {
      config.messageOut.println(
          "Parsing file "
              + this.filename.toString()
              + // NOI18N
              " with handler "
              + this.handler.getClass()); // NOI18N
    }

    try {
      startupReader();
      this.handler.startDocument(config.getDocRoot());
      this.parse();
      shutdownReader();
      this.handler.endDocument();
    } catch (FileNotFoundException e) {
      config.messageOut.println("Error: file " + this.filename.toString() + " not found"); // NOI18N
      throw e;
      /*
          } catch (IllegalStateException e) {
          throw e;
      } catch (RuntimeException e) {
              TraceLogger.error(e);
          throw e;
           */
    }
  }
예제 #2
0
 public DocDefParser(GenBeans.Config config, DocDefHandler handler) {
   this.config = config;
   this.filename = config.getFilename();
   this.schemaIn = config.getFileIn();
   this.handler = handler;
 }