Skip to content

Commit c47aeb7

Browse files
committed
improved jdoc
1 parent 0eaccf8 commit c47aeb7

13 files changed

Lines changed: 87 additions & 26 deletions

src/main/java/org/htmlunit/html/HtmlLink.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,11 @@ public CssStyleSheet getSheet() {
359359
}
360360
return sheet_;
361361
}
362-
363362
/**
364-
* @return true if the rel attribute is 'stylesheet'
363+
* Returns whether this link references a style sheet.
364+
*
365+
* @return {@code true} if the {@code rel} attribute contains
366+
* {@code stylesheet}
365367
*/
366368
public boolean isStyleSheetLink() {
367369
final String rel = getRelAttribute();
@@ -372,7 +374,10 @@ public boolean isStyleSheetLink() {
372374
}
373375

374376
/**
375-
* @return true if the rel attribute is 'modulepreload'
377+
* Returns whether this link references a module preload.
378+
*
379+
* @return {@code true} if the {@code rel} attribute contains
380+
* {@code modulepreload}
376381
*/
377382
public boolean isModulePreloadLink() {
378383
final String rel = getRelAttribute();

src/main/java/org/htmlunit/html/HtmlMedia.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public final String getSrcAttribute() {
5353
}
5454

5555
/**
56-
* @return the value of the {@code src} value
56+
* Returns the fully qualified source URL.
57+
*
58+
* @return the fully qualified value of the {@code src} attribute
5759
*/
5860
public String getSrc() {
5961
final String src = getSrcAttribute();

src/main/java/org/htmlunit/html/HtmlOption.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ public final boolean isDefaultSelected() {
168168
}
169169

170170
/**
171-
* @return {@code true} if the disabled attribute is set for this element
171+
* Returns whether this element is disabled.
172+
*
173+
* @return {@code true} if this element is disabled, either because it has
174+
* the {@code disabled} attribute or because it is contained in a
175+
* disabled ancestor element
172176
*/
173177
@Override
174178
public final boolean isDisabled() {

src/main/java/org/htmlunit/html/HtmlOptionGroup.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public class HtmlOptionGroup extends HtmlElement implements DisabledElement {
4949
}
5050

5151
/**
52-
* @return {@code true} if the disabled attribute is set for this element
52+
* Returns whether this element is disabled.
53+
*
54+
* @return {@code true} if this element is disabled, either because it has
55+
* the {@code disabled} attribute or because one of its ancestor
56+
* elements is disabled
5357
*/
5458
@Override
5559
public final boolean isDisabled() {

src/main/java/org/htmlunit/html/HtmlPage.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ public HtmlElement getDocumentElement() {
389389
}
390390

391391
/**
392-
* @return the <code>body</code> element, or {@code null} if it does not yet exist
392+
* Returns the document's {@code body} element.
393+
*
394+
* @return the document's {@code body} element, or {@code null} if it does
395+
* not exist
393396
*/
394397
public HtmlBody getBody() {
395398
final DomElement doc = getDocumentElement();
@@ -2592,8 +2595,11 @@ public void setElementWithFocus(final DomElement elementWithFocus) {
25922595

25932596
/**
25942597
* <p><span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span></p>
2598+
* Returns the currently active element.
25952599
*
2596-
* @return the element with focus or the body
2600+
* @return the element that currently has focus, or the document's
2601+
* {@code body} element if no element has focus, or {@code null}
2602+
* if the document has no {@code body} element
25972603
*/
25982604
public HtmlElement getActiveElement() {
25992605
final DomElement activeElement = getFocusedElement();
@@ -2774,7 +2780,9 @@ public List<CssStyleSheet> getStyleSheets() {
27742780
}
27752781

27762782
/**
2777-
* @return the CSSPropertiesCache for this page
2783+
* Returns the computed styles cache for this page.
2784+
*
2785+
* @return the computed styles cache for this page
27782786
*/
27792787
private ComputedStylesCache getCssPropertiesCache() {
27802788
if (computedStylesCache_ == null) {

src/main/java/org/htmlunit/html/HtmlRangeInput.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ public class HtmlRangeInput extends HtmlInput implements LabelableElement {
6161
}
6262

6363
/**
64-
* @return the min as double
64+
* Returns the numeric value of the {@code min} attribute.
65+
*
66+
* @return the value of the {@code min} attribute as a {@code double}, or
67+
* {@code 0} if the attribute is not defined or cannot be parsed
6568
*/
6669
public double getMinNumeric() {
6770
final String min = getAttributeDirect("min");
@@ -77,7 +80,10 @@ public double getMinNumeric() {
7780
}
7881

7982
/**
80-
* @return the max as double
83+
* Returns the numeric value of the {@code max} attribute.
84+
*
85+
* @return the value of the {@code max} attribute as a {@code double}, or
86+
* {@code 100} if the attribute is not defined or cannot be parsed
8187
*/
8288
public double getMaxNumeric() {
8389
final String max = getAttributeDirect("max");
@@ -93,7 +99,10 @@ public double getMaxNumeric() {
9399
}
94100

95101
/**
96-
* @return the max as double
102+
* Returns the numeric value of the {@code step} attribute.
103+
*
104+
* @return the value of the {@code step} attribute as a {@code double}, or
105+
* {@code 1} if the attribute is not defined or cannot be parsed
97106
*/
98107
public double getStepNumeric() {
99108
final String step = getAttributeDirect("step");

src/main/java/org/htmlunit/http/HttpUtils.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,11 @@ else if (c == '+') {
234234
}
235235

236236
/**
237-
* @param parameters the paramters
238-
* @param charset the charset
239-
* @return the query string from the given parameters
237+
* Converts the specified form parameters to a URL-encoded query string.
238+
*
239+
* @param parameters the form parameters
240+
* @param charset the character set to use for encoding
241+
* @return the URL-encoded query string
240242
*/
241243
public static String toQueryFormFields(final Iterable<? extends NameValuePair> parameters, final Charset charset) {
242244
final StringBuilder result = new StringBuilder();

src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Object execute(HtmlPage page,
149149
int startLine);
150150

151151
/**
152+
* Returns this JavaScript engine's {@link HtmlUnitContextFactory}.
153+
*
152154
* @return this JavaScript engine's {@link HtmlUnitContextFactory}
153155
*/
154156
HtmlUnitContextFactory getContextFactory();

src/main/java/org/htmlunit/javascript/host/draganddrop/DataTransfer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public void jsConstructor() {
4040
}
4141

4242
/**
43+
* Returns the {@code files} property.
44+
*
4345
* @return the {@code files} property
4446
*/
4547
@JsxGetter
@@ -48,6 +50,8 @@ public FileList getFiles() {
4850
}
4951

5052
/**
53+
* Returns the {@code items} property.
54+
*
5155
* @return the {@code items} property
5256
*/
5357
@JsxGetter

src/main/java/org/htmlunit/javascript/host/draganddrop/DataTransferItem.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ private DataTransferItem(final String kind, final String type, final Object data
6262
}
6363

6464
/**
65+
* Creates a string data transfer item.
66+
*
6567
* @param data the data
6668
* @param type the type
6769
* @return a new {@link DataTransferItem}
@@ -71,6 +73,8 @@ public static DataTransferItem buildStringItem(final CharSequence data, final St
7173
}
7274

7375
/**
76+
* Creates a file data transfer item.
77+
*
7478
* @param file the file
7579
* @return a new {@link DataTransferItem}
7680
*/
@@ -87,6 +91,8 @@ public void jsConstructor() {
8791
}
8892

8993
/**
94+
* Returns the {@code type} property.
95+
*
9096
* @return the {@code type} property
9197
*/
9298
@JsxGetter
@@ -95,6 +101,8 @@ public String getKind() {
95101
}
96102

97103
/**
104+
* Returns the {@code type} property.
105+
*
98106
* @return the {@code type} property
99107
*/
100108
@JsxGetter
@@ -103,8 +111,8 @@ public String getType() {
103111
}
104112

105113
/**
106-
* Invokes the given callback with the drag data item's string data as the argument
107-
* if the item's kind is a Plain unicode string (i.e. kind is string).
114+
* Invokes the given callback with the drag data item's string data if the item contains a plain Unicode string.
115+
*
108116
* @param callback Function to execute
109117
*/
110118
@JsxFunction
@@ -133,7 +141,9 @@ public void execute() {
133141
}
134142

135143
/**
136-
* @return the drag data item's File object. If the item is not a file, this method returns null.
144+
* Returns the file represented by this drag data item.
145+
*
146+
* @return the drag data item's {@link File}, or {@code null} if this item is not a file
137147
*/
138148
@JsxFunction
139149
public File getAsFile() {
@@ -145,7 +155,9 @@ public File getAsFile() {
145155
}
146156

147157
/**
148-
* @return true if this is a file
158+
* Returns whether this item represents a file.
159+
*
160+
* @return {@code true} if this item represents a file
149161
*/
150162
public boolean isFile() {
151163
return kind_ == KIND_FILE;

0 commit comments

Comments
 (0)