Skip to content

Commit b3cc9db

Browse files
committed
Comments
1 parent eca4893 commit b3cc9db

17 files changed

Lines changed: 265 additions & 86 deletions

core-java/src/main/java/eu/neverblink/jelly/core/JellyConverterFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final ProtoEncoder<TNode> encoder(ProtoEncoder.Params params) {
5252
* @return decoder
5353
*/
5454
public final ProtoDecoder<TNode, TDatatype> triplesDecoder(
55-
RdfHandler.TripleStatementHandler<TNode> tripleProtoHandler,
55+
RdfHandler.TripleHandler<TNode> tripleProtoHandler,
5656
RdfStreamOptions supportedOptions
5757
) {
5858
return new ProtoDecoderImpl.TriplesDecoder<>(decoderConverter(), tripleProtoHandler, supportedOptions);
@@ -67,7 +67,7 @@ public final ProtoDecoder<TNode, TDatatype> triplesDecoder(
6767
* @return decoder
6868
*/
6969
public final ProtoDecoder<TNode, TDatatype> quadsDecoder(
70-
RdfHandler.QuadStatementHandler<TNode> quadProtoHandler,
70+
RdfHandler.QuadHandler<TNode> quadProtoHandler,
7171
RdfStreamOptions supportedOptions
7272
) {
7373
return new ProtoDecoderImpl.QuadsDecoder<>(decoderConverter(), quadProtoHandler, supportedOptions);
@@ -82,7 +82,7 @@ public final ProtoDecoder<TNode, TDatatype> quadsDecoder(
8282
* @return decoder
8383
*/
8484
public final ProtoDecoder<TNode, TDatatype> graphsAsQuadsDecoder(
85-
RdfHandler.QuadStatementHandler<TNode> graphProtoHandler,
85+
RdfHandler.QuadHandler<TNode> graphProtoHandler,
8686
RdfStreamOptions supportedOptions
8787
) {
8888
return new ProtoDecoderImpl.GraphsAsQuadsDecoder<>(decoderConverter(), graphProtoHandler, supportedOptions);
@@ -97,7 +97,7 @@ public final ProtoDecoder<TNode, TDatatype> graphsAsQuadsDecoder(
9797
* @return decoder
9898
*/
9999
public final ProtoDecoder<TNode, TDatatype> graphsDecoder(
100-
RdfHandler.GraphStatementHandler<TNode> graphProtoHandler,
100+
RdfHandler.GraphHandler<TNode> graphProtoHandler,
101101
RdfStreamOptions supportedOptions
102102
) {
103103
return new ProtoDecoderImpl.GraphsDecoder<>(decoderConverter(), graphProtoHandler, supportedOptions);
@@ -112,7 +112,7 @@ public final ProtoDecoder<TNode, TDatatype> graphsDecoder(
112112
* @return decoder
113113
*/
114114
public final ProtoDecoder<TNode, TDatatype> anyDecoder(
115-
RdfHandler.AnyStatementHandler<TNode> anyProtoHandler,
115+
RdfHandler.AnyRdfHandler<TNode> anyProtoHandler,
116116
RdfStreamOptions supportedOptions
117117
) {
118118
return new ProtoDecoderImpl.AnyStatementDecoder<>(decoderConverter(), anyProtoHandler, supportedOptions);

core-java/src/main/java/eu/neverblink/jelly/core/ProtoEncoder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
public abstract class ProtoEncoder<TNode>
1313
extends ProtoEncoderBase<TNode>
14-
implements RowBufferAppender, RdfHandler.AnyStatementHandler<TNode> {
14+
implements RowBufferAppender, RdfHandler.AnyRdfHandler<TNode> {
1515

1616
/**
1717
* Parameters passed to the Jelly encoder.
@@ -46,6 +46,4 @@ protected ProtoEncoder(ProtoEncoderConverter<TNode> converter, Params params) {
4646
this.enableNamespaceDeclarations = params.enableNamespaceDeclarations;
4747
this.appendableRowBuffer = params.appendableRowBuffer;
4848
}
49-
50-
public abstract void handleNamespace(String prefix, String namespace);
5149
}

core-java/src/main/java/eu/neverblink/jelly/core/RdfHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ default void handleNamespace(String prefix, TNode namespace) {
1919
* Extension of the ProtoHandler interface to handle triples.
2020
* @param <TNode> The type of the nodes in the RDF data structure, as bound by library.
2121
*/
22-
interface TripleStatementHandler<TNode> extends RdfHandler<TNode> {
22+
interface TripleHandler<TNode> extends RdfHandler<TNode> {
2323
/**
2424
* Handle a triple.
2525
* @param subject The subject of the triple, as represented by node in the RDF data structure.
@@ -33,7 +33,7 @@ interface TripleStatementHandler<TNode> extends RdfHandler<TNode> {
3333
* Extension of the ProtoHandler interface to handle quads.
3434
* @param <TNode> The type of the nodes in the RDF data structure, as bound by library.
3535
*/
36-
interface QuadStatementHandler<TNode> extends RdfHandler<TNode> {
36+
interface QuadHandler<TNode> extends RdfHandler<TNode> {
3737
/**
3838
* Handle a quad.
3939
* @param subject The subject of the quad, as represented by node in the RDF data structure.
@@ -48,7 +48,7 @@ interface QuadStatementHandler<TNode> extends RdfHandler<TNode> {
4848
* Extension of the ProtoHandler interface to handle graphs.
4949
* @param <TNode> The type of the nodes in the RDF data structure, as bound by library.
5050
*/
51-
interface GraphStatementHandler<TNode> extends RdfHandler<TNode> {
51+
interface GraphHandler<TNode> extends RdfHandler<TNode> {
5252
/**
5353
* Handle a graph start.
5454
* @param graph The graph node, as represented by node in the RDF data structure.
@@ -74,12 +74,12 @@ interface GraphStatementHandler<TNode> extends RdfHandler<TNode> {
7474
* Extension of the ProtoHandler interface to handle Triples and Quads.
7575
* @param <TNode> The type of the nodes in the RDF data structure, as bound by library.
7676
*/
77-
interface TripleOrQuadStatementHandler<TNode> extends TripleStatementHandler<TNode>, QuadStatementHandler<TNode> {}
77+
interface AnyStatementHandler<TNode> extends TripleHandler<TNode>, QuadHandler<TNode> {}
7878

7979
/**
8080
* Extension of the ProtoHandler interface to handle any RDF data structure.
8181
* @param <TNode> The type of the nodes in the RDF data structure, as bound by library.
8282
*/
83-
interface AnyStatementHandler<TNode>
84-
extends TripleStatementHandler<TNode>, QuadStatementHandler<TNode>, GraphStatementHandler<TNode> {}
83+
interface AnyRdfHandler<TNode>
84+
extends TripleHandler<TNode>, QuadHandler<TNode>, GraphHandler<TNode> {}
8585
}

core-java/src/main/java/eu/neverblink/jelly/core/RdfProtoDeserializationError.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package eu.neverblink.jelly.core;
22

3+
/**
4+
* This exception is thrown when there is an error during the deserialization of a
5+
* protocol buffer message from RDF.
6+
*/
37
public final class RdfProtoDeserializationError extends RuntimeException {
48

59
public RdfProtoDeserializationError(String msg) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
package eu.neverblink.jelly.core;
22

3+
/**
4+
* This exception is thrown when there is an error during the serialization of a
5+
* protocol buffer message to RDF.
6+
*/
37
public final class RdfProtoSerializationError extends RuntimeException {
48

59
public RdfProtoSerializationError(String msg) {
610
super(msg);
711
}
12+
13+
public RdfProtoSerializationError(String msg, Throwable cause) {
14+
super(msg, cause);
15+
}
816
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package eu.neverblink.jelly.core;
22

3+
/**
4+
* Exception thrown when an error occurs during the transcoding of RDF ProtoBuf data.
5+
*/
36
public final class RdfProtoTranscodingError extends RuntimeException {
47

58
public RdfProtoTranscodingError(String msg) {
69
super(msg);
710
}
11+
12+
public RdfProtoTranscodingError(String msg, Throwable cause) {
13+
super(msg, cause);
14+
}
815
}

0 commit comments

Comments
 (0)