Package org.apache.uima.cas.impl

Examples of org.apache.uima.cas.impl.XmiCasSerializer


      FileOutputStream out = null;

      try {
        // write XMI
        out = new FileOutputStream(name);
        XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
        XMLSerializer xmlSer = new XMLSerializer(out, false);
        ser.serialize(aCas, xmlSer.getContentHandler());
      } finally {
        if (out != null) {
          out.close();
        }
      }
View Full Code Here


          throw new IllegalArgumentException("No documentID for CAS:\n" + jCas);
        }
        File outFile = toXMIFile(options, new File(documentID));
        FileOutputStream stream = new FileOutputStream(outFile);
        ContentHandler handler = new XMLSerializer(stream).getContentHandler();
        new XmiCasSerializer(jCas.getTypeSystem()).serialize(jCas.getCas(), handler);
        stream.close();
      }
    }
  }
View Full Code Here

    File outFile = new File(outputDirectory, id );
    FileOutputStream out = null;

    try {
      out = new FileOutputStream(outFile);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    }
    finally {
      if (out != null) {
        out.close();
      }
View Full Code Here

    FileOutputStream out = null;

    try {
      // write XMI
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } finally {
      if (out != null) {
        out.close();
      }
    }
View Full Code Here

    FileOutputStream out = null;

    try {
      // write XMI
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } finally {
      if (out != null) {
        out.close();
      }
    }
View Full Code Here

  private static void writeXmi(CAS cas, File file) throws IOException, SAXException {
    FileOutputStream out = null;
    try {
      out = new FileOutputStream(file);
      XmiCasSerializer ser = new XmiCasSerializer(cas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(cas, xmlSer.getContentHandler());
    } finally {
      if (out != null) {
        out.close();
      }
    }
View Full Code Here

      name.getParentFile().mkdirs();
      if (!name.exists()) {
        name.createNewFile();
      }
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } catch (Exception e) {
      RutaIdePlugin.error(e);
    } finally {
      if (out != null) {
        out.close();
View Full Code Here

    FileOutputStream out = null;

    try {
      // write XMI
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } catch (Exception e) {
      throw e;
    } finally {
      if (out != null) {
        out.close();
View Full Code Here

    FileOutputStream out = null;

    try {
      // write XMI
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } finally {
      if (out != null) {
        out.close();
      }
    }
View Full Code Here

    FileOutputStream out = null;

    try {
      // write XMI
      out = new FileOutputStream(name);
      XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
      XMLSerializer xmlSer = new XMLSerializer(out, false);
      ser.serialize(aCas, xmlSer.getContentHandler());
    } catch (Exception e) {
      RutaIdePlugin.error(e);
    } finally {
      if (out != null) {
        out.close();
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.impl.XmiCasSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.