private void staxError(int line, int col, String msg) { errorHandler.error(msg, line, col) ; } }
/** Note a tuple not being output */ protected void skipOne(X object, String printForm, long line, long col) { errorHandler.warning("Skip: " + printForm, line, col); }
@Override public void fatalError(Exception e) { Pair<Integer, Integer> p = getLineCol(e) ; errorHandler.fatal(e.getMessage(), p.getLeft(), p.getRight()) ; }
public static boolean checkLiteral(String lexicalForm, String lang, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( ! WarnOnBadLiterals ) return true ; boolean hasLang = lang != null && ! lang.equals("") ; if ( datatype != null && hasLang ) handler.error("Literal has datatype and language", line, col) ; // Datatype check (and plain literals are always well formed) if ( datatype != null ) return validateByDatatype(lexicalForm, datatype, handler, line, col) ; // No datatype. Language? if ( hasLang ) { // Not a perfect test. if ( lang.length() > 0 && ! langPattern.matcher(lang).matches() ) { handler.warning("Language not valid: "+lang, line, col) ; return false; } } return true ; }
protected static boolean validateByDatatypeDateTime(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( lexicalForm.contains(" ") ) { handler.warning("Whitespace in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } if ( lexicalForm.contains("\n") ) { handler.warning("Newline in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } if ( lexicalForm.contains("\r") ) { handler.warning("Newline in XSD date or time literal: '"+lexicalForm+"'", line, col) ; return false ; } //if ( ! StrictXSDLexicialForms ) // Jena is already strict. return validateByDatatypeJena(lexicalForm, datatype, handler, line, col) ; }
public boolean checkBlank(Node node, long line, long col) { String x = node.getBlankNodeLabel() ; if ( x.indexOf(' ') >= 0 ) { handler.error("Illegal blank node label (contains a space): " + node, line, col) ; return false ; } return true ; } }
((Map) jsonObject).put("@context", jsonldCtx); } else { errorHandler.warning("Unexpected: not a Map; unable to set JsonLD's @context",-1,-1); errorHandler.error(ex.getOriginalMessage(), loc.getLineNr(), loc.getColumnNr()); throw new RiotException(ex.getOriginalMessage()) ; errorHandler.error(e.getMessage(), -1, -1); IO.exception(e) ;
@Override public void fatalError(Exception e) { Pair<Integer, Integer> p = getLineCol(e) ; errorHandler.fatal(e.getMessage(), p.getLeft(), p.getRight()) ; }
/** Note a tuple not being output */ protected void skipOne(X object, String printForm, long line, long col) { profile.getHandler().warning("Skip: "+printForm, line, col) ; }
public boolean checkBlank(Node node, long line, long col) { String x = node.getBlankNodeLabel() ; if ( x.indexOf(' ') >= 0 ) { handler.error("Illegal blank node label (contains a space): "+node, line, col) ; return false ; } return true ; } }
protected final void raiseException(RiotParseException ex) { if ( errorHandler != null ) errorHandler.fatal(ex.getOriginalMessage(), ex.getLine(), ex.getCol()); throw ex; } }
protected static boolean checkWhitespace(String lexicalForm, RDFDatatype datatype, ErrorHandler handler, long line, long col) { if ( lexicalForm.contains(" ") ) { handler.warning("Whitespace in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } if ( lexicalForm.contains("\n") ) { handler.warning("Newline in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } if ( lexicalForm.contains("\r") ) { handler.warning("Newline in "+xsdDatatypeName(datatype)+" literal: '" + lexicalForm + "'", line, col) ; return false ; } return true ; }
private void error(String message, Object... args) { String msg = String.format(message, args); long line = reader.getLineNum(); long col = reader.getColNum(); errorHandler.error(msg, line, col); // We require that errors cause the tokenizer to stop so in case the // provided error handler does not, we throw an exception. throw new RiotParseException(message, line, col); } }
private String expandPrefixedName(String prefix, String localPart, Token token) { String expansion = prologue.getPrefixMap().expand(prefix, localPart) ; if (expansion == null) errorHandler.fatal("Undefined prefix: " + prefix, token.getLine(), token.getColumn()) ; return expansion ; }
private void warning(String message, Object... args) { String msg = String.format(message, args); errorHandler.warning(msg, reader.getLineNum(), reader.getColNum()); //exception(message, args); }
@Override public void error(Exception e) { Pair<Integer, Integer> p = getLineCol(e) ; errorHandler.error(e.getMessage(), p.getLeft(), p.getRight()) ; }
protected final void raiseException(RiotParseException ex) { ErrorHandler errorHandler = profile.getHandler() ; if ( errorHandler != null ) errorHandler.fatal(ex.getOriginalMessage(), ex.getLine(), ex.getCol()) ; throw ex ; } }