Beispiel #1
0
 /** Конструктор по умолчанию */
 public FormatXMLWriter() {
   try {
     outline = new OutlineXMLWriter(createXMLWriter(System.out));
   } catch (XMLStreamException ex) {
     XMLUtil.fireException(ex);
     outline = null;
   }
 }
Beispiel #2
0
  public FormatXMLWriter(File file, Charset encoding) throws FileNotFoundException {
    if (file == null) {
      throw new IllegalArgumentException("file == null");
    }
    if (encoding == null) {
      throw new IllegalArgumentException("encoding == null");
    }

    FileOutputStream fout = null;
    fout = new FileOutputStream(file);
    Writer wr = new OutputStreamWriter(fout, encoding);

    try {
      outline = new OutlineXMLWriter(createXMLWriter(wr));
    } catch (XMLStreamException ex) {
      XMLUtil.fireException(ex);
      outline = null;
    }
  }