throws RDFParseException return createLiteral(label, lang, datatype, parserConfig, errListener, valueFactory, -1, -1);
throws RDFParseException reportError(msg, -1, -1, relevantSetting, parserConfig, errListener);
/** * Reports a fatal error to the registered ParseErrorListener, if any, and * throws a <tt>ParseException</tt> afterwards. This method simply calls * {@link #reportFatalError(String, long, long, ParseErrorListener)} * supplying <tt>-1</tt> for the line- and column number. * * @since 2.7.1 */ public static void reportFatalError(String msg, ParseErrorListener errListener) throws RDFParseException { reportFatalError(msg, -1, -1, errListener); }
try { if (!nextHandler.verifyLanguage(workingLabel, workingLang.get())) { reportError("'" + lang + "' is not a valid language tag ", lineNo, columnNo, BasicParserSettings.VERIFY_LANGUAGE_TAGS, parserConfig, errListener); reportError( "'" + label + " could not be verified by a language handler that recognised it. language was " reportError( "'" + label + "' did not have a valid value for language " + lang + ": " + e.getMessage() + " and could not be normalised", reportError( "'" + label + "' was not recognised as a language literal, and could not be verified, with language " try { if (!nextHandler.verifyDatatype(workingLabel, workingDatatype)) { reportError("'" + label + "' is not a valid value for datatype " + datatype, lineNo, columnNo, BasicParserSettings.VERIFY_DATATYPE_VALUES, parserConfig, errListener); reportError( "'" + label + " could not be verified by a datatype handler that recognised it. datatype was " reportError( "'" + label + "' is not a valid value for datatype " + datatype + ": "
/** * Creates a {@link Literal} object with the supplied parameters. */ protected Literal createLiteral(String label, String lang, IRI datatype) throws RDFParseException { return RDFParserHelper.createLiteral(label, lang, datatype, getParserConfig(), getParseErrorListener(), valueFactory); }
/** * Reports a fatal error to the registered ParseErrorListener, if any, and * throws a <tt>ParseException</tt> afterwards. An exception is made for the * case where the supplied exception is a {@link RDFParseException}; in that * case the supplied exception is not wrapped in another ParseException and * the error message is not reported to the ParseErrorListener, assuming that * it has already been reported when the original ParseException was thrown. * <p> * This method simply calls * {@link #reportFatalError(Exception, long, long, ParseErrorListener)} * supplying <tt>-1</tt> for the line- and column number. * * @since 2.7.1 */ public static void reportFatalError(Exception e, ParseErrorListener errListener) throws RDFParseException { reportFatalError(e, -1, -1, errListener); }
/** * Reports an error with associated line- and column number to the registered * ParseErrorListener, if the given setting has been set to true. * <p> * This method also throws an {@link RDFParseException} when the given * setting has been set to <tt>true</tt> and it is not a nonFatalError. * * @param msg * The message to use for * {@link ParseErrorListener#error(String, long, long)} and for * {@link RDFParseException#RDFParseException(String, long, long)}. * @param relevantSetting * The boolean setting that will be checked to determine if this is an * issue that we need to look at at all. If this setting is true, then * the error listener will receive the error, and if * {@link ParserConfig#isNonFatalError(RioSetting)} returns true an * exception will be thrown. * @throws RDFParseException * If {@link ParserConfig#get(RioSetting)} returns true, and * {@link ParserConfig#isNonFatalError(RioSetting)} returns true for * the given setting. */ protected void reportError(String msg, RioSetting<Boolean> relevantSetting) throws RDFParseException { RDFParserHelper.reportError(msg, relevantSetting, getParserConfig(), getParseErrorListener()); }
/** * Creates a {@link Literal} object with the supplied parameters, using the * lineNo and columnNo to enhance error messages or exceptions that may be * generated during the creation of the literal. * * @since 2.7.4 * @see org.openrdf.rio.helpers.RDFParserHelper#createLiteral(String, String, * IRI, ParserConfig, ParseErrorListener, ValueFactory, long, long) */ protected Literal createLiteral(String label, String lang, IRI datatype, long lineNo, long columnNo) throws RDFParseException { return RDFParserHelper.createLiteral(label, lang, datatype, getParserConfig(), getParseErrorListener(), valueFactory, lineNo, columnNo); }
/** * Reports a fatal error to the registered ParseErrorListener, if any, and * throws a <tt>ParseException</tt> afterwards. This method simply calls * {@link #reportFatalError(String,long,long)} supplying <tt>-1</tt> for the * line- and column number. */ protected void reportFatalError(String msg) throws RDFParseException { RDFParserHelper.reportFatalError(msg, getParseErrorListener()); }
throws RDFParseException RDFParserHelper.reportError(e, lineNo, columnNo, relevantSetting, getParserConfig(), getParseErrorListener());
private void triple(String s, String p, String value, String datatype, String language, String graph) { if (s == null || p == null || value == null) { // TODO: i don't know what to do here!!!! return; } final Resource subject = createResource(s); final URI predicate = vf.createURI(p); final URI datatypeURI = datatype == null ? null : vf.createURI(datatype); Value object; try { object = RDFParserHelper.createLiteral(value, language, datatypeURI, getParserConfig(), getParserErrorListener(), getValueFactory()); } catch (final RDFParseException e) { throw new RuntimeException(e); } Statement result; if (graph == null) { result = vf.createStatement(subject, predicate, object); } else { result = vf.createStatement(subject, predicate, object, createResource(graph)); } if (handler != null) { try { handler.handleStatement(result); } catch (final RDFHandlerException e) { throw new RuntimeException(e); } } }
/** * Reports a fatal error with associated line- and column number to the * registered ParseErrorListener, if any, and throws a * <tt>ParseException</tt> afterwards. */ protected void reportFatalError(String msg, long lineNo, long columnNo) throws RDFParseException { RDFParserHelper.reportFatalError(msg, lineNo, columnNo, getParseErrorListener()); }
throws RDFParseException RDFParserHelper.reportError(msg, lineNo, columnNo, relevantSetting, getParserConfig(), getParseErrorListener());
/** * Reports a fatal error to the registered ParseErrorListener, if any, and * throws a <tt>ParseException</tt> afterwards. An exception is made for the * case where the supplied exception is a {@link RDFParseException}; in that * case the supplied exception is not wrapped in another ParseException and * the error message is not reported to the ParseErrorListener, assuming that * it has already been reported when the original ParseException was thrown. * <p> * This method simply calls {@link #reportFatalError(Exception,long,long)} * supplying <tt>-1</tt> for the line- and column number. */ protected void reportFatalError(Exception e) throws RDFParseException { RDFParserHelper.reportFatalError(e, getParseErrorListener()); }
/** * Reports a fatal error with associated line- and column number to the * registered ParseErrorListener, if any, and throws a * <tt>ParseException</tt> wrapped the supplied exception afterwards. An * exception is made for the case where the supplied exception is a * {@link RDFParseException}; in that case the supplied exception is not * wrapped in another ParseException and the error message is not reported to * the ParseErrorListener, assuming that it has already been reported when * the original ParseException was thrown. */ protected void reportFatalError(Exception e, long lineNo, long columnNo) throws RDFParseException { RDFParserHelper.reportFatalError(e, lineNo, columnNo, getParseErrorListener()); }