/** * Set the source to {@link Path}. * This clears any other source setting. * <p> * The parser can be reused. * @param path * @return this */ public RDFParserBuilder source(Path path) { clearSource(); this.path = path; return this; }
/** * Set the source to a URI; this includes OS file names. * File URL should be of the form {@code file:///...}. * This clears any other source setting. * <p> * The parser can be reused. * @param uriOrFile * @return this */ public RDFParserBuilder source(String uriOrFile) { clearSource(); this.uri = uriOrFile; return this; }
/** * Use the given string as the content to parse. * This clears any other source setting. * <p> * The syntax must be set with {@code .lang(...)}. * <p> * The parser can be reused. * @param string The characters to be parsed. * @return this */ public RDFParserBuilder fromString(String string) { clearSource(); this.content = string; return this; }
/** * Set the source to {@link InputStream}. * This clears any other source setting. * <p> * The syntax must be set with {@code .lang(...)}. * <p> * The {@link InputStream} will be closed when the * parser is called and the parser can not be reused. * @param input * @return this */ public RDFParserBuilder source(InputStream input) { clearSource(); this.inputStream = input; return this; }
/** * Set the source to {@link StringReader}. * This clears any other source setting. * The {@link StringReader} will be closed when the * parser is called and the parser can not be reused. * <p> * The syntax must be set with {@code .lang(...)}. * <p> * Consider using {@link #fromString} instead. * @param reader * @return this */ public RDFParserBuilder source(StringReader reader) { clearSource(); this.javaReader = reader; return this; }
/** * Set the source to {@link Reader}. * This clears any other source setting. * The {@link Reader} will be closed when the * parser is called and the parser can not be reused. * <p> * The syntax must be set with {@code .lang(...)}. * @param reader * @return this * @deprecated Use {@link #fromString}, or an InputStream or a StringReader. */ @Deprecated public RDFParserBuilder source(Reader reader) { clearSource(); this.javaReader = reader; return this; }