Examples of TaeError


Examples of org.apache.uima.caseditor.core.TaeError

      ArrayFS array = (ArrayFS) value.getFeatureStructure();

      return getElements(array.get(value.slot()));
    }
    else {
      throw new TaeError("Unexpected element type!");
    }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

        // false for primitive arrays
        return false;
      }
    }
    else {
      throw new TaeError("Unkown element type");
    }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

      try {
        resourceManager.setExtensionClassPath(resourceBasePath.getLocation().toOSString(), true);
        resourceManager.setDataPath(resourceBasePath.getLocation().toOSString());
      } catch (MalformedURLException e) {
        // this should never happen
        throw new TaeError("Unexpected exception", e);
      }
    }

    try {
      CasConsumer consumer = UIMAFramework.produceCasConsumer(casConsumerDescriptor,
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

      ArrayValue arrayValue = (ArrayValue) cell.getElement();

      cell.setText(Integer.toString(arrayValue.slot()));
    }
    else {
      throw new TaeError("Unkown element!");
    }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

        } else if (type.getName().equals(CAS.TYPE_NAME_STRING_ARRAY)) {
          fs = document.getCAS().createStringArrayFS(arraySize);
        } else if (type.getName().equals(CAS.TYPE_NAME_FS_ARRAY)) {
          fs = document.getCAS().createArrayFS(arraySize);
        } else {
          throw new TaeError("Unkown array type!");
        }
      }

      return fs;
    }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

      try {
        typeSystemDesciptor = (TypeSystemDescription) xmlParser
                .parse(xmlTypeSystemSource);
      } catch (InvalidXMLException e1) {
        throw new TaeError("Integrated ts.xml typesystem descriptor is not valid!");
      }

      try {
        return CasCreationUtils.createCas(typeSystemDesciptor,
                    null, null);
      } catch (ResourceInitializationException e) {

        // should not happen
        throw new TaeError("Unexpected exception!");
      }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

    if (DocumentFormat.XCAS.equals(format)) {
      try {
        XCASSerializer.serialize(cas, out);
      } catch (SAXException e) {
        // should not happen
        throw new TaeError("Unexpected exception!", e);
      } catch (IOException e) {
        // will not happen, writing to memory
        throw new TaeError("Unexpected exception!", e);
      }
    }
    else if (DocumentFormat.XMI.equals(format)) {
      try {
      XmiCasSerializer.serialize(cas, out);
    } catch (SAXException e) {
      // should not happen
      throw new TaeError("Unexpected exception!", e);
    }
    }
    else {
      throw new TaeError("Unkown document type!", null);
    }
   
    return new ByteArrayInputStream(out.toByteArray());
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

      }
      else if (!type.isArray()) {
        fs = document.getCAS().createFS(type);
      }
      else {
        throw new TaeError("Unexpected error!");
      }

      return fs;
    }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

      try {
        typeSystemDesciptor = (TypeSystemDescription) xmlParser
                .parse(xmlTypeSystemSource);
      } catch (InvalidXMLException e1) {
        throw new TaeError("Integrated ts.xml typesystem descriptor is not valid!");
      }

      try {
        return CasCreationUtils.createCas(typeSystemDesciptor,
                    null, null);
      } catch (ResourceInitializationException e) {

        // should not happen
        throw new TaeError("Unexpected exception!");
      }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.core.TaeError

    if (DocumentFormat.XCAS.equals(format)) {
      try {
        XCASSerializer.serialize(cas, out);
      } catch (SAXException e) {
        // should not happen
        throw new TaeError(failedToImportLine + e.getMessage(), e);
      } catch (IOException e) {
        // will not happen, writing to memory
        throw new TaeError(failedToImportLine + e.getMessage(), e);
      }
    }
    else if (DocumentFormat.XMI.equals(format)) {
      try {
        XmiCasSerializer.serialize(cas, out);
      } catch (SAXException e) {
        // should not happen
        throw new TaeError(failedToImportLine + e.getMessage(), e);
      }
    } else {
      throw new TaeError(failedToImportLine + "Unkown document type!", null);
    }

    return new ByteArrayInputStream(out.toByteArray());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.