private void oneProperty(ARPOptions options, String pName, Object value) { if (! pName.startsWith("ERR_") && ! pName.startsWith("IGN_") && ! pName.startsWith("WARN_")) return ; int cond = ParseException.errorCode(pName); if (cond == -1) throw new RiotException("No such ARP property: '"+pName+"'"); int val; if (value instanceof String) { if (!((String) value).startsWith("EM_")) throw new RiotException("Value for ARP property does not start EM_: '"+pName+"' = '"+value+"'" ); val = ParseException.errorCode((String) value); if (val == -1 ) throw new RiotException("Illegal value for ARP property: '"+pName+"' = '"+value+"'" ); } else if (value instanceof Integer) { val = ((Integer) value).intValue(); switch (val) { case ARPErrorNumbers.EM_IGNORE: case ARPErrorNumbers.EM_WARNING: case ARPErrorNumbers.EM_ERROR: case ARPErrorNumbers.EM_FATAL: break; default: throw new RiotException("Illegal value for ARP property: '"+pName+"' = '"+value+"'" ); } } else { throw new RiotException("Property \"" + pName + "\" cannot have value: " + value.toString()); } options.setErrorMode(cond, val); }
void initExpectedFromModel() { StmtIterator si = testID.listProperties(errorCodes); if (si.hasNext()) { expected = new HashSet<>(); while (si.hasNext()) { String uri = si.nextStatement().getResource().getURI(); String fieldName = uri.substring(uri.lastIndexOf('#') + 1); expected.add(new Integer(ParseException.errorCode(fieldName))); } } } void initExpected() {
void initExpectedFromModel() { StmtIterator si = testID.listProperties(errorCodes); if (si.hasNext()) { expected = new HashSet<>(); while (si.hasNext()) { String uri = si.nextStatement().getResource().getURI(); String fieldName = uri.substring(uri.lastIndexOf('#') + 1); expected.add(new Integer(ParseException.errorCode(fieldName))); } } } void initExpected() {