Skip to content

Commit a012e1e

Browse files
Added javadoc for jax-rs (#184)
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
1 parent fd1e6b2 commit a012e1e

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

http/restful-ws/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ You need to configure the `CloudEventsProvider` to enable marshalling/unmarshall
1919
Below is a sample on how to read and write CloudEvents:
2020

2121
```java
22-
import io.cloudevents.CloudEvent;import io.cloudevents.core.builder.CloudEventBuilder;
22+
import io.cloudevents.CloudEvent;
23+
import io.cloudevents.core.builder.CloudEventBuilder;
2324

2425
import javax.ws.rs.GET;
2526
import javax.ws.rs.POST;

http/restful-ws/src/main/java/io/cloudevents/http/restful/ws/BinaryEncoding.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

25+
/**
26+
* Annotate a method with this annotation to specify that you want to write the returned event
27+
* in binary mode.
28+
*/
2529
@Target(ElementType.METHOD)
2630
@Retention(RetentionPolicy.RUNTIME)
2731
public @interface BinaryEncoding {

http/restful-ws/src/main/java/io/cloudevents/http/restful/ws/CloudEventsProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@
4646
import java.util.Arrays;
4747
import java.util.Optional;
4848

49+
/**
50+
* This provider implements {@link CloudEvent} encoding and decoding for Jax-Rs Resources and {@link javax.ws.rs.client.Client}
51+
*/
4952
@Provider
5053
@Consumes(MediaType.WILDCARD)
5154
@Produces(MediaType.WILDCARD)
5255
public class CloudEventsProvider implements MessageBodyReader<CloudEvent>, MessageBodyWriter<CloudEvent>, ClientRequestFilter {
5356

57+
/**
58+
* The content type to use when sending {@link CloudEvent} with {@link javax.ws.rs.client.Client}
59+
*/
5460
public static MediaType CLOUDEVENT_TYPE = MediaType.valueOf("application/cloudevents");
5561

5662
@Override

http/restful-ws/src/main/java/io/cloudevents/http/restful/ws/StructuredEncoding.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

25+
/**
26+
* Annotate a method with this annotation to specify that you want to write the returned event
27+
* in structured mode.
28+
*/
2529
@Target(ElementType.METHOD)
2630
@Retention(RetentionPolicy.RUNTIME)
2731
public @interface StructuredEncoding {
32+
/**
33+
* Specify the content type of the structured mode
34+
* (used to resolve the {@link io.cloudevents.core.format.EventFormat} through the {@link io.cloudevents.core.provider.EventFormatProvider})
35+
*/
2836
String value();
2937
}

0 commit comments

Comments
 (0)