RDFParserBuilder javadoc on exceptions
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/6f1f669a Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/6f1f669a Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/6f1f669a Branch: refs/heads/master Commit: 6f1f669a38a05e61d40cbbfd1572e0127244669b Parents: 5e41513 Author: Stian Soiland-Reyes <st...@apache.org> Authored: Mon Mar 28 02:06:16 2016 +0100 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Fri Apr 1 16:19:59 2016 +0100 ---------------------------------------------------------------------- .../commons/rdf/api/RDFParserBuilder.java | 32 +++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/6f1f669a/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java b/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java index 3a853f5..6d2d1d0 100644 --- a/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java +++ b/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java @@ -109,11 +109,11 @@ public interface RDFParserBuilder { * or <code>text/turtle;charset="UTF-8"</code> as specified by * <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1"> * RFC7231</a>. + * @return An {@link RDFParserBuilder} that will use the specified content + * type. * @throws IllegalArgumentException * If the contentType has an invalid syntax, or this * RDFParserBuilder does not support the specified contentType. - * @return An {@link RDFParserBuilder} that will use the specified content - * type. */ RDFParserBuilder contentType(String contentType); @@ -171,8 +171,10 @@ public interface RDFParserBuilder { * @param base * An absolute IRI to use as a base. * @return An {@link RDFParserBuilder} that will use the specified base IRI. + * @throws IllegalArgumentException + * If the base is not a valid absolute IRI string */ - RDFParserBuilder base(String base); + RDFParserBuilder base(String base) throws IllegalArgumentException; /** * Specify a source {@link InputStream} to parse. @@ -294,8 +296,11 @@ public interface RDFParserBuilder { * @param iri * An IRI to retrieve and parse * @return An {@link RDFParserBuilder} that will use the specified source. + * @throws IllegalArgumentException + * If the base is not a valid absolute IRI string + * */ - RDFParserBuilder source(String iri); + RDFParserBuilder source(String iri) throws IllegalArgumentException; /** * Parse the specified source. @@ -319,12 +324,23 @@ public interface RDFParserBuilder { * <p> * If {@link #intoGraph(Graph)} has been specified, this SHOULD be the same * {@link Graph} instance returned from {@link Future#get() once parsing has - * completed. + * completed successfully. + * <p> + * If an exception occurs during parsing, (e.g. {@link IOException} or + * {@link java.text.ParseException}, it should be indicated as the + * {@link java.util.concurrent.ExecutionException#getCause()) in the + * {@link java.util.concurrent.ExecutionException) thrown on + * {@link Future#get()}. * - * @return A Future that will return the populated graph when the parsing - * has finished. + * @return A Future that will return the populated {@link Graph} when the + * parsing has finished. * @throws IOException - * If an error occurred while reading the source. + * If an error occurred while starting to read the source (e.g. + * file not found, unsupported IRI protocol). Note that IO + * errors during parsing would instead be the + * {@link java.util.concurrent.ExecutionException#getCause()) of + * the {@link java.util.concurrent.ExecutionException) thrown on + * {@link Future#get()}. * @throws IllegalStateException * If the builder is in an invalid state, e.g. a * <code>source</code> has not been set.