Examples of CASRuntimeException


Examples of org.apache.uima.cas.CASRuntimeException

  }

  SofaFS getSofa(int sofaRef) {
    SofaFS aSofa = (SofaFS) this.ll_getFSForRef(sofaRef);
    if (aSofa == null) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFAREF_NOT_FOUND);
      throw e;
    }
    return aSofa;
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

        return url.openStream();
      } else {
        return null;
      }
    } catch (MalformedURLException exc) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFADATASTREAM_ERROR,
          new String[] { exc.getMessage() });
      throw e;
    } catch (CASRuntimeException exc) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFADATASTREAM_ERROR,
          new String[] { exc.getMessage() });
      throw e;
    } catch (IOException exc) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFADATASTREAM_ERROR,
          new String[] { exc.getMessage() });
      throw e;
    }
    return null;
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

        }
      }
      this.getLongHeap().heapPos = longheapsz;

    } catch (IOException e) {
      CASRuntimeException exception = new CASRuntimeException(
          CASRuntimeException.BLOB_DESERIALIZATION, new String[] { e.getMessage() });
      throw exception;
    }
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

  }

  void copyFeatures(int trgAddr, int srcAddr) throws CASRuntimeException {
    int typeCode = getHeapValue(trgAddr);
    if (typeCode != getHeapValue(srcAddr)) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_TYPE);
      // What's that supposed to mean? Internationalized, my foot.
      // TODO: fix exception argument.
      // e.addArgument("Type of source and target feature structures do not match");
      throw (e);
    }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

    } else if (typeCode == ts.longTypeCode) {
      return Long.toString(this.getLongValue(addr, feat));
    } else if (typeCode == ts.doubleTypeCode) {
      return Double.toString(this.getDoubleValue(addr, feat));
    } else {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_RANGE,
          new String[] { ts.ll_getFeatureForCode(feat).getName(), ts.ll_getTypeForCode(typeCode).getName() });
      throw e;
    }

  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

    } else if (typeCode == ts.longTypeCode) {
      this.setFeatureValue(fsref, feat, Long.parseLong(value));
    } else if (typeCode == ts.doubleTypeCode) {
      this.setFeatureValue(fsref, feat, Double.parseDouble(value));
    } else {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_TYPE,
          new String[] { ts.ll_getFeatureForCode(feat).getName(), ts.ll_getTypeForCode(typeCode).getName() });
      throw e;
    }
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

   * @deprecated
   */
  public JCas getJCas(SofaID aSofaID) throws CASException {
    SofaFS sofa = getSofa(aSofaID);
    if (sofa == null) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_NOT_FOUND,
          new String[] { aSofaID.getSofaID() });
      throw e;
    }
    return getJCas(sofa);
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

      absoluteSofaName = aSofaID;
    }

    // Can't use name of Initial View
    if (CAS.NAME_DEFAULT_SOFA.equals(absoluteSofaName)) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_ALREADY_EXISTS,
          new String[] { aSofaID });
      throw e;
    }
    SofaFS newSofa = createSofa(absoluteSofaName, null);
    CAS newView = getView(newSofa);
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

      return getInitialView();
    }
    // get Sofa and switch to view
    SofaFS sofa = getSofa(absoluteSofaName);
    if (sofa == null) {
      CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_NOT_FOUND,
          new String[] { absoluteSofaName });
      throw e;
    }
    return getView(sofa);
  }
View Full Code Here

Examples of org.apache.uima.cas.CASRuntimeException

      String id = aSofa.getSofaID();
//      final Feature idFeat = getTypeSystem().getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
//      String id = getLowLevelCAS().ll_getStringValue(((FeatureStructureImpl)aSofa).getAddress(),
//          ((FeatureImpl) idFeat).getCode());
      if (this.svd.sofaNameSet.contains(id)) {
        CASRuntimeException e = new CASRuntimeException(
            CASRuntimeException.SOFANAME_ALREADY_EXISTS, new String[] { id });
        throw e;
      }
      this.svd.sofaNameSet.add(id);
    }
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.