Skip to content

Commit 1818a1d

Browse files
committed
updated docs and reformat
1 parent 5e0cfb6 commit 1818a1d

File tree

97 files changed

+3269
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3269
-144
lines changed

domino-rest-client/src/main/java/org/dominokit/rest/DominoRestConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ public static DominoRestConfig initDefaults() {
8888
return DominoRestConfig.getInstance();
8989
}
9090

91-
/** @return new instance */
91+
/**
92+
* @return new instance
93+
*/
9294
public static DominoRestConfig getInstance() {
9395
return new DominoRestConfig();
9496
}

domino-rest-client/src/main/java/org/dominokit/rest/js/DefaultServiceRoot.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
/** This is the default service root which reads it from the browser location */
2222
public class DefaultServiceRoot {
2323

24-
/** @return the service root */
24+
/**
25+
* @return the service root
26+
*/
2527
public static String get() {
2628
Location location = DomGlobal.window.location;
2729
String protocol = location.protocol;

domino-rest-client/src/main/java/org/dominokit/rest/js/DominoSimpleEventsBus.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@
2727
public class DominoSimpleEventsBus implements EventsBus<Event<EventProcessor>> {
2828
private static final Logger LOGGER = LoggerFactory.getLogger(DominoSimpleEventsBus.class);
2929

30+
/** The singleton instance of the event bus. */
3031
public static final EventsBus INSTANCE = new DominoSimpleEventsBus(new EventProcessor());
3132

3233
private final EventBus simpleGwtEventsBus;
3334
private final EventProcessor eventProcessor;
3435

36+
/**
37+
* Creates a new instance.
38+
*
39+
* @param eventProcessor the {@link EventProcessor} to use
40+
*/
3541
public DominoSimpleEventsBus(EventProcessor eventProcessor) {
3642
this.simpleGwtEventsBus = new SimpleEventBus();
3743
this.eventProcessor = eventProcessor;

domino-rest-client/src/main/java/org/dominokit/rest/js/JsResponse.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
/** JS implementation for the {@link Response} */
3333
public class JsResponse implements Response {
3434

35+
/** The {@link XMLHttpRequest} instance. */
3536
private final XMLHttpRequest request;
37+
38+
/** The response bean. */
3639
private Object responseBean;
3740

3841
JsResponse(XMLHttpRequest request) {
@@ -86,7 +89,9 @@ public ArrayBuffer getResponseArrayBuffer() {
8689
return Js.cast(request.response);
8790
}
8891

89-
/** @return the {@code XMLHttpRequest} associated with this response. */
92+
/**
93+
* @return the {@code XMLHttpRequest} associated with this response.
94+
*/
9095
public XMLHttpRequest getRequest() {
9196
return request;
9297
}
@@ -96,6 +101,12 @@ public byte[] getBodyAsBytes() {
96101
return toByteArray(getResponseArrayBuffer());
97102
}
98103

104+
/**
105+
* Converts an {@link ArrayBuffer} to a byte array.
106+
*
107+
* @param buffer the {@link ArrayBuffer} to convert
108+
* @return the resulting byte array
109+
*/
99110
public static byte[] toByteArray(ArrayBuffer buffer) {
100111
Int8Array view = new Int8Array(buffer); // signed bytes [-128,127]
101112
int len = (int) view.length;
@@ -106,7 +117,14 @@ public static byte[] toByteArray(ArrayBuffer buffer) {
106117
return out;
107118
}
108119

109-
/** Copy a slice (offset/length in bytes) into a Java byte[]. */
120+
/**
121+
* Copy a slice (offset/length in bytes) into a Java byte[].
122+
*
123+
* @param buffer the {@link ArrayBuffer} to copy from
124+
* @param byteOffset the offset in bytes
125+
* @param length the length in bytes
126+
* @return the resulting byte array
127+
*/
110128
public static byte[] toByteArray(ArrayBuffer buffer, int byteOffset, int length) {
111129
Int8Array view = new Int8Array(buffer, byteOffset, length);
112130
int len = (int) view.length;
@@ -117,6 +135,11 @@ public static byte[] toByteArray(ArrayBuffer buffer, int byteOffset, int length)
117135
return out;
118136
}
119137

138+
/**
139+
* Sets the response bean.
140+
*
141+
* @param responseBean the response bean to set
142+
*/
120143
public void setResponseBean(Object responseBean) {
121144
this.responseBean = responseBean;
122145
}

domino-rest-client/src/main/java/org/dominokit/rest/js/JsRestfulRequest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,22 @@
3737
/** JS implementation for {@link RestfulRequest} that uses {@link XMLHttpRequest} */
3838
public class JsRestfulRequest extends BaseRestfulRequest {
3939

40+
/** Content-Type header name. */
4041
public static final String CONTENT_TYPE = "Content-Type";
42+
43+
/** PDF media type. */
4144
public static final String APPLICATION_PDF = "application/pdf";
45+
46+
/** The {@link XMLHttpRequest} instance. */
4247
private final XMLHttpRequest request;
48+
49+
/** The map of parameters. */
4350
private final Map<String, List<String>> params = new LinkedHashMap<>();
51+
52+
/** The map of headers. */
4453
private final Map<String, String> headers = new LinkedHashMap<>();
54+
55+
/** The timer for handling timeouts. */
4556
private final Timer timer =
4657
new Timer() {
4758
@Override
@@ -50,6 +61,12 @@ public void run() {
5061
}
5162
};
5263

64+
/**
65+
* Creates a new instance.
66+
*
67+
* @param uri the request URI
68+
* @param method the HTTP method
69+
*/
5370
public JsRestfulRequest(String uri, String method) {
5471
super(uri, method);
5572
request = new XMLHttpRequest();

domino-rest-client/src/main/java/org/dominokit/rest/js/ServerFailedRequestEvent.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@
2828
@SuppressWarnings({"unchecked", "rawtypes"})
2929
public class ServerFailedRequestEvent extends ServerFailedRequestGwtEvent implements Event {
3030

31+
/** The {@link ServerRequest} associated with this event. */
3132
protected final ServerRequest request;
33+
34+
/** The failed response bean. */
3235
private final FailedResponseBean failedResponseBean;
3336

37+
/**
38+
* Creates a new instance.
39+
*
40+
* @param request the {@link ServerRequest}
41+
* @param failedResponseBean the failed response bean
42+
*/
3443
ServerFailedRequestEvent(ServerRequest request, FailedResponseBean failedResponseBean) {
3544
this.request = request;
3645
this.failedResponseBean = failedResponseBean;

domino-rest-client/src/main/java/org/dominokit/rest/js/ServerFailedRequestGwtEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/** An {@link org.gwtproject.event.shared.EventBus} failed event */
2222
public abstract class ServerFailedRequestGwtEvent extends Event<EventProcessor> {
2323

24+
/** The event type for server failed request events. */
2425
protected static final Event.Type<EventProcessor> SERVER_FAILED_REQUEST_EVENT_TYPE =
2526
new Event.Type<>();
2627

domino-rest-client/src/main/java/org/dominokit/rest/js/ServerSuccessRequestEvent.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@
3030
@SuppressWarnings({"unchecked", "rawtypes"})
3131
public class ServerSuccessRequestEvent<T> extends ServerSuccessRequestGwtEvent implements Event {
3232

33+
/** The {@link ServerRequest} associated with this event. */
3334
protected final ServerRequest request;
35+
36+
/** The response bean received from the server. */
3437
private final T responseBean;
3538

39+
/**
40+
* Creates a new instance.
41+
*
42+
* @param request the {@link ServerRequest}
43+
* @param responseBean the response bean
44+
*/
3645
public ServerSuccessRequestEvent(ServerRequest request, T responseBean) {
3746
this.request = request;
3847
this.responseBean = responseBean;

domino-rest-jvm/src/main/java/org/dominokit/rest/DominoRestConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public static DominoRestConfig initDefaults() {
8989
return DominoRestConfig.getInstance();
9090
}
9191

92-
/** @return new instance */
92+
/**
93+
* @return new instance
94+
*/
9395
public static DominoRestConfig getInstance() {
9496
return new DominoRestConfig();
9597
}

domino-rest-jvm/src/main/java/org/dominokit/rest/jvm/DefaultServiceRoot.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
/** Default service root configuration for JVM environment. */
1919
public class DefaultServiceRoot {
2020

21+
/**
22+
* @return the default service root URL
23+
*/
2124
public static String get() {
2225
return "http://localhost:8080/";
2326
}

0 commit comments

Comments
 (0)