commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [43/50] [abbrv] incubator-commonsrdf git commit: RDFParserBuilder javadoc on exceptions
Date Sat, 02 Jul 2016 16:15:00 GMT
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/8951eb1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/8951eb1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/8951eb1d

Branch: refs/heads/jena
Commit: 8951eb1dc7fd112725ac0bc2757e5952c874a238
Parents: d7623dd
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Mon Mar 28 02:06:16 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Tue Mar 29 14:06:50 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/8951eb1d/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.


Mime
View raw message