Skip to content

Commit bd777f7

Browse files
committed
jdoc checkstyle
1 parent 8b9cfe0 commit bd777f7

File tree

12 files changed

+128
-2
lines changed

12 files changed

+128
-2
lines changed

src/main/java/org/htmlunit/WebRequest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
*/
5757
public class WebRequest implements Serializable {
5858

59+
/**
60+
* Enum to configure request creation.
61+
*/
5962
public enum HttpHint {
6063
/** Force to include the charset. */
6164
IncludeCharsetInContentTypeHeader,
@@ -655,13 +658,21 @@ public void setDefaultResponseContentCharset(final Charset defaultResponseConten
655658
this.defaultResponseContentCharset_ = Objects.requireNonNull(defaultResponseContentCharset);
656659
}
657660

661+
/**
662+
* @param hint the hint to check for
663+
* @return true if the hint is enabled
664+
*/
658665
public boolean hasHint(final HttpHint hint) {
659666
if (httpHints_ == null) {
660667
return false;
661668
}
662669
return httpHints_.contains(hint);
663670
}
664671

672+
/**
673+
* Enables the hint.
674+
* @param hint the hint to add
675+
*/
665676
public void addHint(final HttpHint hint) {
666677
if (httpHints_ == null) {
667678
httpHints_ = EnumSet.noneOf(HttpHint.class);

src/main/java/org/htmlunit/httpclient/HttpClientConverter.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@ public static URL replaceForCookieIfNecessary(URL url) {
267267
return url;
268268
}
269269

270+
/**
271+
* @param cookieString the string to parse
272+
* @param pageUrl the page url as root
273+
* @param browserVersion the {@link BrowserVersion}
274+
* @return a list of {@link org.htmlunit.util.Cookie}'s
275+
* @throws MalformedCookieException in case the cookie does not conform to the spec
276+
*/
270277
public static List<org.htmlunit.util.Cookie> parseCookie(final String cookieString, final URL pageUrl,
271278
final BrowserVersion browserVersion)
272279
throws MalformedCookieException {
@@ -311,6 +318,13 @@ public static List<org.htmlunit.util.Cookie> fromHttpClient(final List<Cookie> c
311318
return list;
312319
}
313320

321+
/**
322+
* Adds all matching cookies to the provided set.
323+
* @param cookies the cookies to select from
324+
* @param normalizedUrl the url to match against
325+
* @param browserVersion the {@link BrowserVersion}
326+
* @param matches the set to add
327+
*/
314328
public static void addMatching(final Set<org.htmlunit.util.Cookie> cookies,
315329
final URL normalizedUrl, final BrowserVersion browserVersion,
316330
final Set<org.htmlunit.util.Cookie> matches) {

src/main/java/org/htmlunit/javascript/host/Element.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,16 @@ public static boolean webkitMatchesSelector(final Context context, final Scripta
15741574
return matches(context, scope, thisObj, args, function);
15751575
}
15761576

1577+
/**
1578+
* Traverses the element and its parents (heading toward the document root) until it finds a node
1579+
* that matches the specified CSS selector.
1580+
* @param context the context
1581+
* @param scope the scope
1582+
* @param thisObj this object
1583+
* @param args the arguments
1584+
* @param function the function
1585+
* @return the found element or null
1586+
*/
15771587
@JsxFunction
15781588
public static Element closest(final Context context, final Scriptable scope,
15791589
final Scriptable thisObj, final Object[] args, final Function function) {

src/main/java/org/htmlunit/javascript/host/css/StyleSheet.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public void jsConstructor() {
5959
// nothing to do
6060
}
6161

62+
/**
63+
* Ctor.
64+
* @param ownerNode the owner node
65+
*/
6266
public StyleSheet(final HTMLElement ownerNode) {
6367
super();
6468
ownerNode_ = ownerNode;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ public void fillRequest(final WebRequest webRequest) {
442442
}
443443
}
444444

445+
/**
446+
* Delegates the KeyDataPair construction to the backend.
447+
* @param name the name
448+
* @param fileName the filename
449+
* @return the constructed {@link KeyDataPair}
450+
*/
445451
public KeyDataPair getKeyDataPair(final String name, final String fileName) {
446452
String contentType = getType();
447453
if (StringUtils.isEmpty(contentType)) {

src/main/java/org/htmlunit/javascript/host/xml/XMLHttpRequest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,11 +1272,19 @@ public void setOnreadystatechange(final Function readyStateChangeHandler) {
12721272
super.setOnreadystatechange(readyStateChangeHandler);
12731273
}
12741274

1275+
/**
1276+
* @return the number of milliseconds a request can take before automatically being terminated.
1277+
* The default value is 0, which means there is no timeout.
1278+
*/
12751279
@JsxGetter
12761280
public int getTimeout() {
12771281
return timeout_;
12781282
}
12791283

1284+
/**
1285+
* Sets the number of milliseconds a request can take before automatically being terminated.
1286+
* @param timeout the timeout in milliseconds
1287+
*/
12801288
@JsxSetter
12811289
public void setTimeout(final int timeout) {
12821290
timeout_ = timeout;

src/main/java/org/htmlunit/platform/canvas/rendering/RenderingBackend.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
*/
2727
public interface RenderingBackend {
2828

29+
/**
30+
* WindingRule to be used while rendering.
31+
*/
2932
enum WindingRule {
3033
/** WindingRule.NON_ZERO. */
3134
NON_ZERO,

src/main/java/org/htmlunit/platform/image/ImageData.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
*/
2828
public interface ImageData extends AutoCloseable {
2929

30+
/**
31+
* <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br>
32+
* @return the {@link IntDimension2D} of this
33+
* @throws IOException in case of error
34+
*/
3035
IntDimension2D getWidthHeight() throws IOException;
3136
}

src/main/java/org/htmlunit/platform/image/ImageIOImageData.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public class ImageIOImageData implements ImageData {
4949

5050
private final ImageReader imageReader_;
5151

52+
/**
53+
* Ctor.
54+
* @param inputStream the {@link InputStream} to read from
55+
* @throws IOException in case of error
56+
*/
5257
public ImageIOImageData(final InputStream inputStream) throws IOException {
5358
final ImageInputStream iis = ImageIO.createImageInputStream(inputStream);
5459
final Iterator<ImageReader> iter = ImageIO.getImageReaders(iis);

src/main/java/org/htmlunit/util/OrderedFastHashMap.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,26 +544,54 @@ public V put(final K key, final V value) {
544544
return this.put(key, value, Position.LAST);
545545
}
546546

547+
/**
548+
* Insert at the beginning.
549+
* @param key the key
550+
* @param value the value
551+
* @return the inserted value
552+
*/
547553
public V addFirst(final K key, final V value) {
548554
return this.put(key, value, Position.FIRST);
549555
}
550556

557+
/**
558+
* Append at the end.
559+
* @param key the key
560+
* @param value the value
561+
* @return the appended value
562+
*/
551563
public V add(final K key, final V value) {
552564
return this.put(key, value, Position.LAST);
553565
}
554566

567+
/**
568+
* Append at the end.
569+
* @param key the key
570+
* @param value the value
571+
* @return the appended value
572+
*/
555573
public V addLast(final K key, final V value) {
556574
return this.put(key, value, Position.LAST);
557575
}
558576

577+
/**
578+
* @return the first value.
579+
*/
559580
public V getFirst() {
560581
return getValue(0);
561582
}
562583

584+
/**
585+
* @return the last value.
586+
*/
563587
public V getLast() {
564588
return getValue(this.orderedListSize_ - 1);
565589
}
566590

591+
/**
592+
* Removes the first entry.
593+
* @return the removed value or null if the map was empty.
594+
*/
567595
public V removeFirst() {
568596
if (this.orderedListSize_ > 0) {
569597
final int pos = this.orderedList_[0];
@@ -573,6 +601,10 @@ public V removeFirst() {
573601
return null;
574602
}
575603

604+
/**
605+
* Removes the last entry.
606+
* @return the removed value or null if the map was empty.
607+
*/
576608
public V removeLast() {
577609
if (this.orderedListSize_ > 0) {
578610
final int pos = this.orderedList_[this.orderedListSize_ - 1];

0 commit comments

Comments
 (0)