Package org.apache.uima.cas

Examples of org.apache.uima.cas.CASRuntimeException


  }

  public AnnotationFS createAnnotation(Type type, int begin, int end) {
    if (this == this.svd.baseCAS) {
      // Can't create annotation on base CAS
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "createAnnotation(Type, int, int)" });
      throw e;
    }
    final TypeSystemImpl ts = this.svd.casMetadata.ts;
    FeatureStructure fs = createFS(type);
View Full Code Here


    }
  }

  public void setDocumentLanguage(String languageCode) {
    if (this == this.svd.baseCAS) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "setDocumentLanguage(String)" });
      throw e;
    }
    // LowLevelCAS llc = getLowLevelCAS();
    LowLevelCAS llc = this;
View Full Code Here

    llc.ll_setStringValue(docAnnotAddr, this.svd.casMetadata.ts.langFeatCode, languageCode);
  }

  public void setDocumentText(String text) {
    if (this == this.svd.baseCAS) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "setDocumentText(String)" });
      throw e;
    }
    setSofaDataString(text, "text");
  }
View Full Code Here

    setSofaDataString(text, "text");
  }

  public void setSofaDataString(String text, String mime) throws CASRuntimeException {
    if (this == this.svd.baseCAS) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "setDocumentText(String)" });
      throw e;
    }

    if (!mySofaIsValid()) {
View Full Code Here

        mime);
  }

  public void setSofaDataArray(FeatureStructure array, String mime) throws CASRuntimeException {
    if (this == this.svd.baseCAS) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "setSofaDataArray(FeatureStructure, mime)" });
      throw e;
    }
    if (!mySofaIsValid()) {
      this.createInitialSofa(null);
View Full Code Here

        mime);
  }

  public void setSofaDataURI(String uri, String mime) throws CASRuntimeException {
    if (this == this.svd.baseCAS) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD,
          new String[] { "setSofaDataURI(String, String)" });
      throw e;
    }
    if (!mySofaIsValid()) {
      this.createInitialSofa(null);
View Full Code Here

   */
  public void addFsToIndexes(FeatureStructure fs) {
    if (fs instanceof AnnotationBaseFS) {
      final CAS sofaView = ((AnnotationBaseFS) fs).getView();
      if (sofaView != this) {
        CASRuntimeException e = new CASRuntimeException(
            CASRuntimeException.ANNOTATION_IN_WRONG_INDEX, new String[] { fs.toString(),
                sofaView.getSofa().getSofaID(), this.getSofa().getSofaID() });
        throw e;
      }
    }
View Full Code Here

    this.svd.trackingMarkList.add(this.svd.trackingMark);
    return this.svd.trackingMark;
  }
   
  private void errorMultipleMarkers() {
    throw new CASRuntimeException(CASRuntimeException.MULTIPLE_CREATE_MARKER);
  }
View Full Code Here

  public SerializationMeasures serialize(AbstractCas cas, Object out, Marker trackingMark,
      CompressLevel compressLevel, CompressStrat compressStrategy) throws IOException {
    SerializationMeasures sm = (doMeasurements) ? new SerializationMeasures() : null;
    CASImpl casImpl = (CASImpl) ((cas instanceof JCas) ? ((JCas)cas).getCas(): cas);
    if (null != trackingMark && !trackingMark.isValid() ) {
      throw new CASRuntimeException(
                CASRuntimeException.INVALID_MARKER, new String[] { "Invalid Marker." });
    }
   
    Serializer serializer = new Serializer(
        casImpl, makeDataOutputStream(out), (MarkerImpl) trackingMark, sm,
View Full Code Here

              if (this.allowPreexistingFS == AllowPreexistingFS.ignore) { //skip elements whose ID is <= mergePoint
                this.state = IGNORING_XMI_ELEMENTS_STATE;
                this.ignoreDepth++;
                return;
              } else if (this.allowPreexistingFS == AllowPreexistingFS.disallow) { //fail
                CASRuntimeException e = new CASRuntimeException(
                        CASRuntimeException.DELTA_CAS_PREEXISTING_FS_DISALLOWED,
                        new String[] {ID_ATTR_NAME + "=" + id,
                                  nameSpaceURI,
                                  localName,
                                  qualifiedName});
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.CASRuntimeException

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.