Skip to content

Commit d1b755d

Browse files
committed
improved jdoc
1 parent 2354923 commit d1b755d

26 files changed

Lines changed: 108 additions & 18 deletions

src/main/java/org/htmlunit/javascript/host/event/BeforeUnloadEvent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,17 @@ private static Object getReturnValueDefault(final BrowserVersion browserVersion)
7878
}
7979

8080
/**
81+
* Returns {@code true} if returnValue holds the beforeunload message.
82+
*
8183
* @return {@code true} if returnValue holds the beforeunload message
8284
*/
8385
public boolean isBeforeUnloadMessageSet() {
8486
return !getReturnValueDefault(getBrowserVersion()).equals(getReturnValue());
8587
}
8688

8789
/**
90+
* Returns the return value associated with the event.
91+
*
8892
* @return the return value associated with the event
8993
*/
9094
@JsxGetter

src/main/java/org/htmlunit/javascript/host/event/BlobEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public void jsConstructor(final String type, final ScriptableObject details) {
6565
}
6666

6767
/**
68+
* Returns the Blob associated with the event.
69+
*
6870
* @return the Blob associated with the event
6971
*/
7072
@JsxGetter

src/main/java/org/htmlunit/javascript/host/event/CloseEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public void jsConstructor(final String type, final ScriptableObject details) {
7575
}
7676

7777
/**
78+
* Returns the code.
79+
*
7880
* @return the code
7981
*/
8082
@JsxGetter

src/main/java/org/htmlunit/javascript/host/file/Blob.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,47 @@ public class Blob extends HtmlUnitScriptable {
6262
* The backend used for saving the blob.
6363
*/
6464
protected abstract static class Backend implements Serializable {
65+
6566
/**
67+
* Returns the name.
68+
*
6669
* @return the name
6770
*/
6871
abstract String getName();
6972

7073
/**
74+
* Returns the last modified timestamp as long.
75+
*
7176
* @return the last modified timestamp as long
7277
*/
7378
abstract long getLastModified();
7479

7580
/**
81+
* Returns the size.
82+
*
7683
* @return the size
7784
*/
7885
abstract long getSize();
7986

8087
/**
88+
* Returns the type.
89+
*
8190
* @param browserVersion the {@link BrowserVersion}
8291
* @return the type
8392
*/
8493
abstract String getType(BrowserVersion browserVersion);
8594

8695
/**
96+
* Returns the text.
97+
*
8798
* @return the text
8899
* @throws IOException in case of error
89100
*/
90101
abstract String getText() throws IOException;
91102

92103
/**
104+
* Returns the bytes.
105+
*
93106
* @param start the start position
94107
* @param end the end position
95108
* @return the bytes
@@ -317,6 +330,7 @@ public Blob(final byte[] bytes, final String contentType) {
317330

318331
/**
319332
* Returns the {@code size} property.
333+
*
320334
* @return the {@code size} property
321335
*/
322336
@JsxGetter
@@ -326,6 +340,7 @@ public long getSize() {
326340

327341
/**
328342
* Returns the {@code type} property.
343+
*
329344
* @return the {@code type} property
330345
*/
331346
@JsxGetter
@@ -334,6 +349,9 @@ public String getType() {
334349
}
335350

336351
/**
352+
* Returns a Promise that resolves with an ArrayBuffer containing the
353+
* data in binary form.
354+
*
337355
* @return a Promise that resolves with an ArrayBuffer containing the
338356
* data in binary form.
339357
*/
@@ -350,6 +368,8 @@ public NativePromise arrayBuffer() {
350368
}
351369

352370
/**
371+
* Returns a new Blob object which contains data from a subset of the blob on which it's called.
372+
*
353373
* @param start An index into the Blob indicating the first byte to include in the new Blob. If you specify
354374
* a negative value, it's treated as an offset from the end of the Blob toward the beginning.
355375
* For example, -10 would be the 10th from last byte in the Blob. The default value is 0.
@@ -402,6 +422,8 @@ public Blob slice(final Object start, final Object end, final Object contentType
402422
}
403423

404424
/**
425+
* Returns a ReadableStream which, upon reading, returns the contents of the Blob.
426+
*
405427
* @return a ReadableStream which, upon reading, returns the contents of the Blob.
406428
*/
407429
@JsxFunction
@@ -410,6 +432,9 @@ public ReadableStream stream() {
410432
}
411433

412434
/**
435+
* Returns a Promise that resolves with a string containing the
436+
* contents of the blob, interpreted as UTF-8.
437+
*
413438
* @return a Promise that resolves with a string containing the
414439
* contents of the blob, interpreted as UTF-8.
415440
*/
@@ -419,6 +444,8 @@ public NativePromise text() {
419444
}
420445

421446
/**
447+
* Returns the bytes of this blob.
448+
*
422449
* @return the bytes of this blob
423450
*/
424451
public byte[] getBytes() {

src/main/java/org/htmlunit/javascript/host/intl/Collator.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*
3232
* @author Ahmed Ashour
3333
* @author Ronald Brill
34+
*
35+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator">MDN Documentation</a>
3436
*/
3537
@JsxClass
3638
public class Collator extends HtmlUnitScriptable {
@@ -43,10 +45,10 @@ public class Collator extends HtmlUnitScriptable {
4345
* JavaScript constructor.
4446
* @param cx the current context
4547
* @param scope the scope
46-
* @param args the arguments to the WebSocket constructor
48+
* @param args the arguments to the Collator constructor
4749
* @param ctorObj the function object
48-
* @param inNewExpr Is new or not
49-
* @return the java object to allow JavaScript to access
50+
* @param inNewExpr {@code true} if invoked with the {@code new} operator
51+
* @return the Java object that JavaScript can access
5052
*/
5153
@JsxConstructor
5254
public static Scriptable jsConstructor(final Context cx, final VarScope scope,

src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
* @author Ahmed Ashour
5050
* @author Ronald Brill
5151
* @author Lai Quang Duong
52+
*
53+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat">MDN Documentation</a>
5254
*/
5355
@JsxClass
5456
public class DateTimeFormat extends HtmlUnitScriptable {
@@ -252,10 +254,10 @@ private static Chronology getChronology(final Map<String, Chronology> chronologi
252254
* JavaScript constructor.
253255
* @param cx the current context
254256
* @param scope the scope
255-
* @param args the arguments to the WebSocket constructor
257+
* @param args the arguments to the DateTimeFormat constructor
256258
* @param ctorObj the function object
257-
* @param inNewExpr Is new or not
258-
* @return the java object to allow JavaScript to access
259+
* @param inNewExpr {@code true} if invoked with the {@code new} operator
260+
* @return the Java object that JavaScript can access
259261
*/
260262
@JsxConstructor
261263
public static Scriptable jsConstructor(final Context cx, final VarScope scope,
@@ -286,7 +288,7 @@ public static Scriptable jsConstructor(final Context cx, final VarScope scope,
286288
/**
287289
* Formats a date according to the locale and formatting options of this {@code DateTimeFormat} object.
288290
* @param object the JavaScript object to convert
289-
* @return the dated formated
291+
* @return the formatted date
290292
*/
291293
@JsxFunction
292294
public String format(final Object object) {
@@ -295,7 +297,8 @@ public String format(final Object object) {
295297
}
296298

297299
/**
298-
* @return A new object with properties reflecting the locale and date and time formatting options
300+
* Returns the resolved options for this Intl.DateTimeFormat object.
301+
* @return a new object with properties reflecting the locale and date and time formatting options
299302
* computed during the initialization of the given {@code DateTimeFormat} object.
300303
*/
301304
@JsxFunction
@@ -363,7 +366,7 @@ static final class DateTimeFormatHelper {
363366
* Formats a date according to the locale and formatting options of this {@code DateTimeFormat} object.
364367
* @param date the JavaScript object to convert
365368
* @param zoneId the current time zone id
366-
* @return the dated formated
369+
* @return the formatted date
367370
*/
368371
String format(final Date date, final ZoneId zoneId) {
369372
TemporalAccessor zonedDateTime = date.toInstant().atZone(zoneId);

src/main/java/org/htmlunit/javascript/host/intl/Intl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
* @author Ahmed Ashour
4949
* @author Lai Quang Duong
5050
* @author Ronald Brill
51+
*
52+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl">MDN Documentation</a>
5153
*/
5254
@JsxClass
5355
public class Intl extends HtmlUnitScriptable {

src/main/java/org/htmlunit/javascript/host/intl/Locale.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
*
3838
* @author Lai Quang Duong
3939
* @author Ronald Brill
40+
*
41+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale">MDN Documentation</a>
4042
*/
4143
@JsxClass
4244
public class Locale extends HtmlUnitScriptable {
@@ -198,6 +200,7 @@ private static void setUnicodeKeyword(final java.util.Locale.Builder builder,
198200
}
199201

200202
/**
203+
* Returns the language subtag.
201204
* @return the language
202205
*/
203206
@JsxGetter
@@ -206,6 +209,7 @@ public Object getLanguage() {
206209
}
207210

208211
/**
212+
* Returns the script subtag.
209213
* @return the script
210214
*/
211215
@JsxGetter
@@ -214,6 +218,7 @@ public Object getScript() {
214218
}
215219

216220
/**
221+
* Returns the region subtag.
217222
* @return the region
218223
*/
219224
@JsxGetter
@@ -222,6 +227,7 @@ public Object getRegion() {
222227
}
223228

224229
/**
230+
* Returns the calendar type.
225231
* @return the calendar type
226232
*/
227233
@JsxGetter
@@ -230,6 +236,7 @@ public Object getCalendar() {
230236
}
231237

232238
/**
239+
* Returns the collation type.
233240
* @return the collation type
234241
*/
235242
@JsxGetter
@@ -238,6 +245,7 @@ public Object getCollation() {
238245
}
239246

240247
/**
248+
* Returns the numbering system.
241249
* @return the numbering system
242250
*/
243251
@JsxGetter
@@ -246,6 +254,7 @@ public Object getNumberingSystem() {
246254
}
247255

248256
/**
257+
* Returns the case first setting.
249258
* @return the case first setting
250259
*/
251260
@JsxGetter
@@ -254,6 +263,7 @@ public Object getCaseFirst() {
254263
}
255264

256265
/**
266+
* Returns the hour cycle.
257267
* @return the hour cycle
258268
*/
259269
@JsxGetter
@@ -262,6 +272,7 @@ public Object getHourCycle() {
262272
}
263273

264274
/**
275+
* Returns whether numeric sorting is used.
265276
* @return whether numeric sorting is used
266277
*/
267278
@JsxGetter
@@ -270,6 +281,7 @@ public boolean isNumeric() {
270281
}
271282

272283
/**
284+
* Returns the base name (without Unicode extensions).
273285
* @return the base name (without Unicode extensions)
274286
*/
275287
@JsxGetter
@@ -333,6 +345,7 @@ public Locale minimize() {
333345
}
334346

335347
/**
348+
* Returns the locale's Unicode locale identifier string.
336349
* @return the locale's Unicode locale identifier string
337350
*/
338351
@JsxFunction(functionName = "toString")

src/main/java/org/htmlunit/javascript/host/intl/NumberFormat.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
* @author Ahmed Ashour
4545
* @author Ronald Brill
4646
* @author Lai Quang Duong
47+
*
48+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat">MDN Documentation</a>
4749
*/
4850
@JsxClass
4951
public class NumberFormat extends HtmlUnitScriptable {
@@ -171,10 +173,10 @@ private static String getPattern(final Map<String, String> formats, final String
171173
* JavaScript constructor.
172174
* @param cx the current context
173175
* @param scope the scope
174-
* @param args the arguments to the WebSocket constructor
176+
* @param args the arguments to the NumberFormat constructor
175177
* @param ctorObj the function object
176-
* @param inNewExpr Is new or not
177-
* @return the java object to allow JavaScript to access
178+
* @param inNewExpr {@code true} if invoked with the {@code new} operator
179+
* @return the Java object that JavaScript can access
178180
*/
179181
@JsxConstructor
180182
public static Scriptable jsConstructor(final Context cx, final VarScope scope,
@@ -204,7 +206,7 @@ public static Scriptable jsConstructor(final Context cx, final VarScope scope,
204206
/**
205207
* Formats a number according to the locale and formatting options of this Intl.NumberFormat object.
206208
* @param object the JavaScript object to convert
207-
* @return the dated formated
209+
* @return the formatted number
208210
*/
209211
@JsxFunction
210212
public String format(final Object object) {
@@ -213,8 +215,9 @@ public String format(final Object object) {
213215
}
214216

215217
/**
216-
* @return A new object with properties reflecting the locale and date and time formatting options
217-
* computed during the initialization of the given {@code DateTimeFormat} object.
218+
* Returns the resolved options for this Intl.NumberFormat object.
219+
* @return a new object with properties reflecting the locale and number formatting options
220+
* computed during the initialization of the given {@code NumberFormat} object.
218221
*/
219222
@JsxFunction
220223
public Scriptable resolvedOptions() {

src/main/java/org/htmlunit/javascript/host/intl/V8BreakIterator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public class V8BreakIterator extends HtmlUnitScriptable {
5151
* JavaScript constructor.
5252
* @param cx the current context
5353
* @param scope the scope
54-
* @param args the arguments to the WebSocket constructor
54+
* @param args the arguments to the V8BreakIterator constructor
5555
* @param ctorObj the function object
56-
* @param inNewExpr Is new or not
57-
* @return the java object to allow JavaScript to access
56+
* @param inNewExpr {@code true} if invoked with the {@code new} operator
57+
* @return the Java object that JavaScript can access
5858
*/
5959
@JsxConstructor
6060
public static Scriptable jsConstructor(final Context cx, final VarScope scope,

0 commit comments

Comments
 (0)