Package org.apache.uima.caseditor.editor

Examples of org.apache.uima.caseditor.editor.DocumentUimaImpl


        InputStream casIn = casFile.getContents();

        org.apache.uima.caseditor.editor.ICasDocument doc;

        try {
          doc = new DocumentUimaImpl(cas, casIn, documentFormat, typeSystemFile.getFullPath().makeRelative().toString());
        } finally {
          try {
            casIn.close();
          } catch (IOException e) {
            // Unable to close file after loading it
View Full Code Here


      IFile file = fileInput.getFile();

      if (document instanceof DocumentUimaImpl) {

        DocumentUimaImpl documentImpl = (DocumentUimaImpl) document;

        ByteArrayOutputStream outStream = new ByteArrayOutputStream(40000);
        documentImpl.serialize(outStream);

        InputStream stream = new ByteArrayInputStream(outStream.toByteArray());
       
        isFileChangeTrackingEnabled = false;
       
View Full Code Here

      mWorkingCopy = null;
      throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
              "Typesystem not available!", null));
    }

    DocumentUimaImpl document = mWorkingCopy.get();

    if (reload || document == null) {

      InputStream in = mDocumentFile.getContents();

      DocumentFormat format;

      if (getResource().getFileExtension().equalsIgnoreCase("xcas")) {
        format = DocumentFormat.XCAS;
      } else if (getResource().getFileExtension().equalsIgnoreCase("xmi")) {
        format = DocumentFormat.XMI;
      } else {
        throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
                "Unkown file extension!", null));
      }

      // TODO: check if this is correct this way
      CAS cas = project.getTypesystemElement().getCAS();

      document = new DocumentUimaImpl(cas, in, format);

      mWorkingCopy = new SoftReference<DocumentUimaImpl>(document);
    }

    return document;
View Full Code Here

        InputStream casIn = casFile.getContents();

        org.apache.uima.caseditor.editor.ICasDocument doc;

        try {
          doc = new DocumentUimaImpl(cas, casIn, documentFormat);
        } finally {
          try {
            casIn.close();
          } catch (IOException e) {
            // Unable to close file after loading it
View Full Code Here

      IFile file = fileInput.getFile();

      if (document instanceof DocumentUimaImpl) {

        DocumentUimaImpl documentImpl = (DocumentUimaImpl) document;

        ByteArrayOutputStream outStream = new ByteArrayOutputStream(40000);
        documentImpl.serialize(outStream);

        InputStream stream = new ByteArrayInputStream(outStream.toByteArray());
       
        isFileChangeTrackingEnabled = false;
       
View Full Code Here

TOP

Related Classes of org.apache.uima.caseditor.editor.DocumentUimaImpl

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.