Package org.apache.uima.cas.impl

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


     
      FileOutputStream out = new FileOutputStream(outputFile);
     
      try {
        // write XMI
        XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
        XMLSerializer xmlSer = new XMLSerializer(out, false);
        try {
          ser.serialize(aCAS, xmlSer.getContentHandler());
        } catch (SAXException e) {
          throw new IOException(e.getMessage());
        }
      } finally {
        if (out != null) {
View Full Code Here


            IStatus.OK, message, e);

        throw new CoreException(s);
      }
    } else if (DocumentFormat.XMI.equals(format)) {
      XmiCasSerializer xmiSerializer = new XmiCasSerializer(mCAS
          .getTypeSystem());

      XMLSerializer xmlSerialzer = new XMLSerializer(out, true);

      try {
        xmiSerializer.serialize(mCAS, xmlSerialzer.getContentHandler());
      } catch (SAXException e) {
        String message = (e.getMessage() != null ? e.getMessage() : "");

        IStatus s = new Status(IStatus.ERROR, CasEditorPlugin.ID,
            IStatus.OK, message, e);
View Full Code Here

     
      FileOutputStream out = new FileOutputStream(outputFile);
     
      try {
        // write XMI
        XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
        XMLSerializer xmlSer = new XMLSerializer(out, false);
        try {
          ser.serialize(aCAS, xmlSer.getContentHandler());
        } catch (SAXException e) {
          throw new IOException(e.getMessage());
        }
      } finally {
        if (out != null) {
View Full Code Here

        throwCoreException(e);
      } catch (SAXException e) {
        throwCoreException(e);
      }
    } else if (DocumentFormat.XMI.equals(format)) {
      XmiCasSerializer xmiSerializer = new XmiCasSerializer(mCAS.getTypeSystem());

      XMLSerializer xmlSerialzer = new XMLSerializer(out, true);

      try {
        xmiSerializer.serialize(mCAS, xmlSerialzer.getContentHandler());
      } catch (SAXException e) {
        throwCoreException(e);
      }
    } else {
      throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, IStatus.OK,
View Full Code Here

      }
      this.main.setXcasFileOpenDir(xmiCasFile.getParentFile());
      try {
        OutputStream outStream = new BufferedOutputStream(new FileOutputStream(xmiCasFile));
        XMLSerializer xmlSerializer = new XMLSerializer(outStream);
        XmiCasSerializer xmiCasSerializer = new XmiCasSerializer(this.main.getCas().getTypeSystem());
        xmiCasSerializer.serialize(this.main.getCas(), xmlSerializer.getContentHandler());
        outStream.close();
      } catch (IOException e) {
        this.main.handleException(e);
      } catch (SAXException e) {
        this.main.handleException(e);
View Full Code Here

        if (mXCAS.equalsIgnoreCase("xcas")) {
          XCASSerializer ser = new XCASSerializer(aCAS.getTypeSystem());
          ser.serialize(aCAS, xmlSer.getContentHandler());
        }
        else {
          XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
          ser.serialize(aCAS, xmlSer.getContentHandler());
        }
      }
    } catch (CASException e) {
      throw new ResourceProcessException(e);
    } catch (IOException e) {
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) {
      RutaAddonsPlugin.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

TOP

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

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.