Use _Buildable instead of explicit build()
Project: http://git-wip-us.apache.org/repos/asf/commons-rdf/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-rdf/commit/aee8a63c Tree: http://git-wip-us.apache.org/repos/asf/commons-rdf/tree/aee8a63c Diff: http://git-wip-us.apache.org/repos/asf/commons-rdf/diff/aee8a63c Branch: refs/heads/fluent-parser Commit: aee8a63c67fb068631bd281415c7c53b8059f298 Parents: 96fb0f0 Author: Stian Soiland-Reyes <st...@apache.org> Authored: Wed Feb 14 22:29:44 2018 +0000 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Wed Feb 14 22:39:59 2018 +0000 ---------------------------------------------------------------------- .../java/org/apache/commons/rdf/api/RDF.java | 10 +++--- .../commons/rdf/api/fluentparser/Async.java | 6 +--- .../rdf/api/fluentparser/NeedSourceBased.java | 6 +--- .../rdf/api/fluentparser/NeedSourceOrBase.java | 6 +--- .../rdf/api/fluentparser/NeedTarget.java | 6 +--- .../rdf/api/fluentparser/NeedTargetOrRDF.java | 6 +--- .../rdf/api/fluentparser/OptionalTarget.java | 6 +--- .../fluentparser/OptionalTargetOrSyntax.java | 21 ++++++++++-- .../commons/rdf/api/fluentparser/Sync.java | 6 +--- .../rdf/api/fluentparser/_Buildable.java | 6 ++-- .../api/fluentparser/_NeedIdentifiedSource.java | 2 -- .../rdf/api/fluentparser/_NeedSourceOrBase.java | 21 ++++++++++++ .../rdf/api/fluentparser/_NeedSyntax.java | 17 ++++++++++ .../rdf/api/fluentparser/_OptionalTarget.java | 21 ++++++++++++ .../org/apache/commons/rdf/api/io/Option.java | 2 +- .../commons/rdf/api/io/ParserFactory.java | 4 +-- .../commons/rdf/api/io/WriterFactory.java | 4 +-- .../commons/rdf/api/io/_SupportedSyntaxes.java | 4 +-- .../rdf/api/fluentparser/package-info.java | 20 ++++++++++++ .../commons/rdf/api/fluentparser/test/Test.java | 34 ++++++++++++++++++++ 20 files changed, 151 insertions(+), 57 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/RDF.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/RDF.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/RDF.java index aaa91e9..633356c 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/RDF.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/RDF.java @@ -267,16 +267,16 @@ public interface RDF { * <p> * The returned factory is thread-safe and can be used multiple times, * however the builders it creates are not immutable or reusable, unless - * frozen with the {@link OptionalTarget#build()} method or equivalent. + * frozen with the {@link _Buildable#build()} method or equivalent. * - * @return ParserFactory + * @return {@link ParserFactory} which can be used * @throws UnsupportedOperationException * If this RDF implementation does not support parsing RDF */ public ParserFactory parserFactory() throws UnsupportedOperationException; /** - * Build a parser for the given RDF syntax. + * Build a configured parser for the given RDF syntax. * <p> * If the RDF syntax is not supported/recognized by this RDF implementation, * return {@link Optional#empty()}, otherwise the returned {@link Optional} @@ -287,7 +287,7 @@ public interface RDF { * As a minimum, one of the * {@link ParserBuilder#source(org.apache.commons.rdf.api.io.ParserSource)} * methods need to be called before calling {@link Sync#parse()} or - * {@link Async#parseAsync()}. For instance: + * {@link Async#parseAsync()} on the returned instance. For instance: * <pre>{@code * * Parsed<Dataset, IRI> p = rdf.parser(RDFSyntax.JSONLD) @@ -313,7 +313,7 @@ public interface RDF { * Note that the returned {@link ParserBuilder} may be mutable and not * thread-safe, and should only be used for parsing once. A reusable, * immutable builder can be created at any step with - * {@link ParserBuilder#build()}. + * {@link _Builder#build()}. * * @param syntax RDF Syntax to build a parser for * @return A {@link ParserBuilder}, or {@link Optional#empty()} if the http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java index ba3fb2d..84fdacd 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java @@ -19,13 +19,9 @@ package org.apache.commons.rdf.api.fluentparser; import java.util.concurrent.Future; -import org.apache.commons.rdf.api.io.Option; import org.apache.commons.rdf.api.io.Parsed; -public interface Async<T, S> extends _Buildable { - Async<T, S> build(); - - <V> Async<T, S> option(Option<V> option, V value); +public interface Async<T, S> extends _Buildable<Async<T,S>> { Future<Parsed<T, S>> parseAsync(); } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java index 54889e1..8086264 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java @@ -19,11 +19,7 @@ package org.apache.commons.rdf.api.fluentparser; import java.io.InputStream; -import org.apache.commons.rdf.api.io.Option; - -public interface NeedSourceBased<T> extends _NeedIdentifiedSource<T>, _Buildable { - NeedSourceBased<T> build(); - <V> NeedSourceBased<T> option(Option<V> option, V value); +public interface NeedSourceBased<T> extends _NeedIdentifiedSource<T>, _Buildable<NeedSourceBased<T>> { Sync<T, InputStream> source(InputStream is); } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java index 91b83b7..66161bc 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java @@ -17,9 +17,5 @@ */ package org.apache.commons.rdf.api.fluentparser; -import org.apache.commons.rdf.api.io.Option; - -public interface NeedSourceOrBase<T> extends _OptionalBase<T>, _NeedIdentifiedSource<T>, _Buildable { - NeedSourceOrBase<T> build(); - <V> NeedSourceOrBase<T> option(Option<V> option, V value); +public interface NeedSourceOrBase<T> extends _NeedSourceOrBase<T>, _Buildable<NeedSourceOrBase<T>> { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java index 4ed3849..55e196e 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java @@ -17,9 +17,5 @@ */ package org.apache.commons.rdf.api.fluentparser; -import org.apache.commons.rdf.api.io.Option; - -interface NeedTarget extends _NeedTarget,_Buildable { - NeedTarget build(); - <V> NeedTarget option(Option<V> option, V value); +interface NeedTarget extends _NeedTarget,_Buildable<NeedTarget> { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java index 109b70d..6949f15 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java @@ -17,9 +17,5 @@ */ package org.apache.commons.rdf.api.fluentparser; -import org.apache.commons.rdf.api.io.Option; - -public interface NeedTargetOrRDF extends _NeedTargetOrRDF,_Buildable { - NeedTargetOrRDF build(); - <V> NeedTargetOrRDF option(Option<V> option, V value); +public interface NeedTargetOrRDF extends _NeedTargetOrRDF,_Buildable<NeedTargetOrRDF> { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java index be8195c..b8d5d03 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java @@ -17,9 +17,5 @@ */ package org.apache.commons.rdf.api.fluentparser; -import org.apache.commons.rdf.api.io.Option; - -public interface OptionalTarget<T> extends _NeedTarget, NeedSourceOrBase<T>,_Buildable { - OptionalTarget<T> build(); - <V> OptionalTarget<T> option(Option<V> option, V value); +public interface OptionalTarget<T> extends _OptionalTarget<T>,_Buildable<OptionalTarget<T>> { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java index 7dee7e4..e4768f8 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java @@ -1,5 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.commons.rdf.api.fluentparser; - -public interface OptionalTargetOrSyntax<T> extends OptionalTarget<T>, _NeedSyntax { - +public interface OptionalTargetOrSyntax<T> extends _OptionalTarget<T>, _NeedSyntax { } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java index c141a18..98de4d8 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java @@ -19,13 +19,9 @@ package org.apache.commons.rdf.api.fluentparser; import java.util.concurrent.ExecutorService; -import org.apache.commons.rdf.api.io.Option; import org.apache.commons.rdf.api.io.Parsed; -public interface Sync<T, S> extends _Buildable{ - Sync<T ,S> build(); - <V> Sync<T, S> option(Option<V> option, V value); - +public interface Sync<T, S> extends _Buildable<Sync<T, S>>{ Async<T, S> async(); Async<T, S> async(ExecutorService executor); Parsed<T, S> parse(); http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java index b21eb9d..5183035 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java @@ -21,14 +21,14 @@ import org.apache.commons.rdf.api.io.Option; import org.apache.commons.rdf.api.io.Option.RequiredOption; import org.apache.commons.rdf.api.io.ParserFactory; -interface _Buildable { +interface _Buildable<Self extends _Buildable<Self>> { /** * Return an immutable builder at the current state. The returned builder * can be re-used multiple times in a thread-safe way. * * @return An immutable builder */ - _Buildable build(); + Self build(); /** * Return a builder with the given option set. @@ -45,6 +45,6 @@ interface _Buildable { * @param value Value to set for option * @return A builder with the given option set */ - <V> _Buildable option(Option<V> option, V value); + <V> Self option(Option<V> option, V value); } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java index 580adf6..cb0a1a8 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java @@ -19,8 +19,6 @@ package org.apache.commons.rdf.api.fluentparser; import java.nio.file.Path; -import javax.xml.transform.Source; - import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.io.ParserSource; http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSourceOrBase.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSourceOrBase.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSourceOrBase.java new file mode 100644 index 0000000..a95b4b2 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSourceOrBase.java @@ -0,0 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.rdf.api.fluentparser; + +interface _NeedSourceOrBase<T> extends _OptionalBase<T>, _NeedIdentifiedSource<T> { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java index 28f0cd1..6ab0142 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java @@ -1,3 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.commons.rdf.api.fluentparser; import org.apache.commons.rdf.api.RDFSyntax; http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalTarget.java new file mode 100644 index 0000000..3a2143e --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalTarget.java @@ -0,0 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.rdf.api.fluentparser; + +interface _OptionalTarget<T> extends _NeedTarget, _NeedSourceOrBase<T> { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/Option.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/Option.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/Option.java index 7cf5c86..43182a0 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/Option.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/Option.java @@ -18,7 +18,7 @@ package org.apache.commons.rdf.api.io; public interface Option<V> { - + public interface RequiredOption<V> extends Option<V> { } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java index b25a536..a1c82fd 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java @@ -18,10 +18,8 @@ package org.apache.commons.rdf.api.io; import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.RDFSyntax; import org.apache.commons.rdf.api.fluentparser.NeedTargetOrRDF; import org.apache.commons.rdf.api.fluentparser.OptionalTargetOrSyntax; -public interface ParserFactory extends _SupportedSyntaxes, OptionalTargetOrSyntax<Dataset> { - NeedTargetOrRDF syntax(RDFSyntax syntax); +public interface ParserFactory extends _SupportedSyntaxes<NeedTargetOrRDF>, OptionalTargetOrSyntax<Dataset> { } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java index 59815f0..ce6c762 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java @@ -17,9 +17,7 @@ */ package org.apache.commons.rdf.api.io; -import org.apache.commons.rdf.api.RDFSyntax; import org.apache.commons.rdf.api.fluentwriter.NeedTarget; -public interface WriterFactory extends _SupportedSyntaxes { - NeedTarget syntax(RDFSyntax syntax); +public interface WriterFactory extends _SupportedSyntaxes<NeedTarget> { } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java index aa3e115..14e64bc 100644 --- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java @@ -4,7 +4,7 @@ import java.util.Set; import org.apache.commons.rdf.api.RDFSyntax; -interface _SupportedSyntaxes { +interface _SupportedSyntaxes<T> { /** * Get set of syntaxes supported by this factory. * <p> @@ -24,5 +24,5 @@ interface _SupportedSyntaxes { * @param syntax RDFSyntax * @return Builder that uses specified syntax */ - Object syntax(RDFSyntax syntax); + T syntax(RDFSyntax syntax); } http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/package-info.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/package-info.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/package-info.java new file mode 100644 index 0000000..ef84a13 --- /dev/null +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/package-info.java @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + */ +package org.apache.commons.rdf.api.fluentparser; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/aee8a63c/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/test/Test.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/test/Test.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/test/Test.java new file mode 100644 index 0000000..3f6fc7d --- /dev/null +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/fluentparser/test/Test.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.rdf.api.fluentparser.test; + +import static org.junit.Assert.*; + +import org.apache.commons.rdf.api.Dataset; +import org.apache.commons.rdf.api.IRI; +import org.apache.commons.rdf.api.RDF; +import org.apache.commons.rdf.api.RDFSyntax; + +public class Test { + + @org.junit.Test + public void testName() throws Exception { + RDF rdf = null; + + rdf.parserFactory(); + } +}