/** * * @param sofaNum 1 if sofa null, or the sofa Xmi Id * @return the FS Repository associated with the sofa xmiId * @throws XCASParsingException */ private FSIndexRepositoryImpl getIndexRepo(String sofa, int sofaXmiId) throws XCASParsingException { // a view with no Sofa will be added to the 1st, _InitialView, index if (sofa == null) { return (FSIndexRepositoryImpl) indexRepositories.get(1); } // translate sofa's xmi:id into its sofanum int sofaAddr; try { sofaAddr = getFsAddrForXmiId(sofaXmiId); } catch (NoSuchElementException e) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(sofaXmiId)); } int sofaNum = casBeingFilled.getFeatureValue(sofaAddr, sofaNumFeatCode); return (FSIndexRepositoryImpl) indexRepositories.get(sofaNum); }
throw createException(XCASParsingException.TEXT_EXPECTED, qualifiedName);
throw createException(XCASParsingException.UNKNOWN_TYPE, typeName); } else { addToOutOfTypeSystemData(
throw createException(XCASParsingException.INTEGER_EXPECTED, featVal); throw createException(XCASParsingException.FLOAT_EXPECTED, featVal); throw createException(XCASParsingException.INTEGER_EXPECTED, featVal); throw createException(XCASParsingException.INTEGER_EXPECTED, featVal); throw createException(XCASParsingException.INTEGER_EXPECTED, featVal);
throw createException(XCASParsingException.ILLEGAL_ID, attrValue);
throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(id)); } else {
throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(id));
if (feat == null) { if (!this.lenient) { throw createException(XCASParsingException.UNKNOWN_FEATURE, featName);
} catch (NoSuchElementException e) { if (!lenient) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(featVal));
} catch (NoSuchElementException e) { if (!lenient) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(arrayVal));
private void remapFSListHeads(int addr) throws SAXParseException { final int type = casBeingFilled.getHeapValue(addr); if (!listUtils.isFsListType(type)) return; int[] feats = casBeingFilled.getTypeSystemImpl().ll_getAppropriateFeatures(type); if (feats.length == 0) return; int headFeat = feats[0]; int featVal = casBeingFilled.getFeatureValue(addr, headFeat); if (featVal != CASImpl.NULL) { int fsValAddr = CASImpl.NULL; try { fsValAddr = getFsAddrForXmiId(featVal); } catch (NoSuchElementException e) { if (!lenient) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(featVal)); } else { //this may be a reference to an out-of-typesystem FS this.sharedData.addOutOfTypeSystemAttribute(addr, CAS.FEATURE_BASE_NAME_HEAD, Integer.toString(featVal)); } } casBeingFilled.setFeatureValue(addr, headFeat, fsValAddr); } }
private int handleFeature(final Type type, int addr, String featName, List<String> featVals) throws SAXException { final FeatureImpl feat = (FeatureImpl) type.getFeatureByBaseName(featName); if (feat == null) { if (!this.lenient) { throw createException(XCASParsingException.UNKNOWN_FEATURE, featName); } else { sharedData.addOutOfTypeSystemChildElements(addr, featName, featVals); } return -1; } handleFeature(addr, feat.getCode(), featVals); return feat.getCode(); }
private XCASParsingException createException(int code, String arg) { XCASParsingException e = createException(code); e.addArgument(arg); return e; }