Skip to content

Commit acfb67a

Browse files
author
nicolaiparlog
committed
Fixed errors in javadoc generation as suggested by doclint.
1 parent fe8b286 commit acfb67a

File tree

10 files changed

+90
-42
lines changed

10 files changed

+90
-42
lines changed

src/main/java/org/codefx/libfx/concurrent/when/ExecuteWhen.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
import javafx.beans.value.ObservableValue;
99

1010
/**
11-
* Builder for {@link ExecuteAlwaysWhen} and {@link ExecuteOnceWhen}.
1211
* <p>
12+
* Builder for {@link ExecuteAlwaysWhen} and {@link ExecuteOnceWhen}.
13+
* </p>
1314
* <h2>Example</h2>A typical use would look like this:
1415
*
1516
* <pre>
16-
* ObservableValue<State> workerState;
17+
* ObservableValue&lt;State&gt; workerState;
1718
* ExecuteWhen.on(workerState)
18-
* .when(state -> state == State.SUCCEEDED)
19-
* .thenOnce(state -> logSuccess())
19+
* .when(state -&gt; state == State.SUCCEEDED)
20+
* .thenOnce(state -&gt; logSuccess())
2021
* .executeWhen();
2122
* </pre>
2223
*

src/main/java/org/codefx/libfx/control/properties/ControlPropertyListenerBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
* it to check the type of the value before casting it to the type accepted by the value processor. If those types do
1919
* not match, this prevents {@link ClassCastException} (which would otherwise be caught and silently ignored). If that
2020
* case occurs frequently, specifying the type to allow the check will improve performance considerably.
21+
* </p>
22+
* <h2>Example</h2>
2123
* <p>
2224
* A typical use looks like this:
2325
*
2426
* <pre>
25-
* ControlProperties.<Boolean> on(control.getProperties())
27+
* ControlProperties.&lt;Boolean&gt; on(control.getProperties())
2628
* .forKey("visible")
2729
* .processValue(this::setVisibility)
2830
* .buildDetached();

src/main/java/org/codefx/libfx/control/properties/ControlPropertyListenerHandle.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
import org.codefx.libfx.listener.handle.ListenerHandle;
44

55
/**
6+
* <p>
67
* This is a {@link ListenerHandle handle} on a {@code ControlPropertyListener}, which can be used to {@link #attach()}
78
* and {@link #detach()} it. The {@code ControlPropertyListener} is no type on its own so it is described here.
9+
* </p>
10+
* <h2>ControlPropertyListener</h2>
811
* <p>
9-
* <h2>ControlPropertyListener</h2> A control property listener listens to the changes in a Control's
12+
* A control property listener listens to the changes in a Control's
1013
* {@link javafx.scene.control.Control#getProperties() propertyMap}. It is created to listen for a specific key and
1114
* hands all new values for that key to a value processor (a {@link java.util.function.Consumer Consumer})..
1215
* <p>
@@ -15,10 +18,12 @@
1518
* <p>
1619
* Regardless of whether a value could be cast and processed or not, it will be removed from the map. So if the same
1720
* value is set repeatedly, the specified value processor is called every time.
21+
* </p>
22+
* <h2>ControlPropertyListenerHandle</h2>
1823
* <p>
19-
* <h2>ControlPropertyListenerHandle</h2> Listener handles are not thread-safe. See {@link ListenerHandle} for details.
20-
* Additionally, a new value might be processed twice if inserted into a map by another thread while {@link #attach()}
21-
* is executed. This behavior should not be relied upon and might change (i.e. be fixed) in the future.
24+
* Listener handles are not thread-safe. See {@link ListenerHandle} for details. Additionally, a new value might be
25+
* processed twice if inserted into a map by another thread while {@link #attach()} is executed. This behavior should
26+
* not be relied upon and might change (i.e. be fixed) in the future.
2227
* <p>
2328
* A listener handle is best created with the {@link ControlPropertyListenerBuilder}.
2429
*/

src/main/java/org/codefx/libfx/control/properties/package-info.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* This package provides functionality to make using a {@link javafx.scene.control.Control Control}'s
44
* {@link javafx.scene.control.Control#getProperties() propertyMap} easier. As such its main use will be to creators of
55
* controls.
6+
* </p>
7+
* <h2>Listening to the Property Map</h2>
68
* <p>
7-
* <h2>Listening to the Property Map</h2> In order to use the property map, a control has to create a listener which
8-
* does these things:
9+
* In order to use the property map, a control has to create a listener which does these things:
910
* <ul>
1011
* <li>identify the correct key
1112
* <li>check whether the value is of the correct type and cast it
@@ -14,14 +15,15 @@
1415
* </ul>
1516
* While implementing such a listener is not difficult, some details have to be considered. This makes the code a little
1617
* lengthy and hinders readability while at the same time repeating the same pattern over and over.
18+
* <h2>ControlPropertyListener</h2>
1719
* <p>
18-
* <h2>ControlPropertyListener</h2> This package provides usability functions to create such a listener in a concise and
19-
* readable way (this code would be inside a control):
20+
* This package provides usability functions to create such a listener in a concise and readable way (this code would be
21+
* inside a control):
2022
*
2123
* <pre>
2224
* ControlProperties.on(getProperties())
2325
* .forKey("SomeKey")
24-
* .processValue(valueString -> System.out.println(valueString))
26+
* .processValue(valueString -&gt; System.out.println(valueString))
2527
* .buildAndAttach();
2628
* </pre>
2729
* It returns an instance of {@link org.codefx.libfx.control.properties.ControlPropertyListenerHandle

src/main/java/org/codefx/libfx/control/webview/WebViews.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private WebViews() {
4242
* @param listener
4343
* the {@link WebViewHyperlinkListener} to add to the web view
4444
* @return a handle on the created listener which allows to attach and detach it; initially detached
45-
* @see WebViews#addHyperlinkListener(WebView, WebViewHyperlinkListener)
45+
* @see #addHyperlinkListener(WebView, WebViewHyperlinkListener)
4646
*/
4747
public static WebViewHyperlinkListenerHandle createHyperlinkListenerHandle(
4848
WebView webView, WebViewHyperlinkListener listener) {
@@ -65,7 +65,7 @@ public static WebViewHyperlinkListenerHandle createHyperlinkListenerHandle(
6565
* @param eventType
6666
* the {@link EventType} of all events passed to the listener
6767
* @return a handle on the created listener which allows to attach and detach it; initially detached
68-
* @see WebViews#addHyperlinkListener(WebView, WebViewHyperlinkListener, EventType)
68+
* @see #addHyperlinkListener(WebView, WebViewHyperlinkListener, HyperlinkEvent.EventType)
6969
*/
7070
public static WebViewHyperlinkListenerHandle createHyperlinkListenerHandle(
7171
WebView webView, WebViewHyperlinkListener listener, EventType eventType) {
@@ -97,8 +97,8 @@ public static WebViewHyperlinkListenerHandle addHyperlinkListener(
9797
}
9898

9999
/**
100-
* {@link #createHyperlinkListenerHandle(WebView, WebViewHyperlinkListener, EventType) Creates} a listener handle
101-
* and immediately {@link WebViewHyperlinkListenerHandle#attach() attaches} it.
100+
* {@link #createHyperlinkListenerHandle(WebView, WebViewHyperlinkListener, HyperlinkEvent.EventType) Creates} a
101+
* listener handle and immediately {@link WebViewHyperlinkListenerHandle#attach() attaches} it.
102102
*
103103
* @param webView
104104
* the {@link WebView} to which the listener will be added
@@ -107,7 +107,7 @@ public static WebViewHyperlinkListenerHandle addHyperlinkListener(
107107
* @param eventType
108108
* the {@link EventType} of all events passed to the listener
109109
* @return a handle on the created listener which allows to attach and detach it; initially attached
110-
* @see #createHyperlinkListenerHandle(WebView, WebViewHyperlinkListener, EventType)
110+
* @see #createHyperlinkListenerHandle(WebView, WebViewHyperlinkListener, HyperlinkEvent.EventType)
111111
*/
112112
public static WebViewHyperlinkListenerHandle addHyperlinkListener(
113113
WebView webView, WebViewHyperlinkListener listener, EventType eventType) {

src/main/java/org/codefx/libfx/control/webview/package-info.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/**
2+
* <p>
23
* This package provides functionality around JavaFX' {@link javafx.scene.web.WebView WebView}. All of it can be
34
* accessed via the utility class {@link org.codefx.libfx.control.webview.WebViews WebViews}.
5+
* </p>
6+
* <h2>Hyperlink Listener</h2>
47
* <p>
5-
* <h2>Hyperlink Listener</h2> The {@code WebView} provides no pleasant way to add an equivalent of Swing's
8+
* The {@code WebView} provides no pleasant way to add an equivalent of Swing's
69
* {@link javax.swing.event.HyperlinkListener HyperlinkListener}.
710
* <p>
811
* This can now be done by implementing a {@link org.codefx.libfx.control.webview.WebViewHyperlinkListener

src/main/java/org/codefx/libfx/dom/StaticDomEventConverter.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Objects;
44

55
import javax.swing.event.HyperlinkEvent;
6+
import javax.swing.event.HyperlinkEvent.EventType;
67

78
import org.w3c.dom.events.Event;
89

@@ -15,9 +16,13 @@
1516
public final class StaticDomEventConverter {
1617

1718
/**
19+
* Indicates whether the specified DOM event can be converted to a {@link HyperlinkEvent}.
20+
*
21+
* @param domEvent
22+
* the DOM-{@link Event}
23+
* @return true if the event's {@link Event#getType() type} has an equivalent {@link EventType EventType}
1824
* @see DomEventConverter#canConvertToHyperlinkEvent(Event)
1925
*/
20-
@SuppressWarnings("javadoc")
2126
public static boolean canConvertToHyperlinkEvent(Event domEvent) {
2227
Objects.requireNonNull(domEvent, "The argument 'domEvent' must not be null.");
2328

@@ -27,9 +32,29 @@ public static boolean canConvertToHyperlinkEvent(Event domEvent) {
2732
}
2833

2934
/**
35+
* Converts the specified DOM event to a hyperlink event.
36+
*
37+
* @param domEvent
38+
* the DOM-{@link Event} from which the {@link HyperlinkEvent} will be created
39+
* @param source
40+
* the source of the {@code domEvent}
41+
* @return a {@link HyperlinkEvent} with the following properties:
42+
* <ul>
43+
* <li> {@link HyperlinkEvent#getEventType() getEventType()} returns the {@link EventType} corresponding to
44+
* the domEvent's type as defined by {@link DomEventType}
45+
* <li> {@link HyperlinkEvent#getSource() getSource()} returns the specified {@code source}
46+
* <li> {@link HyperlinkEvent#getURL() getUrl()} returns the href-attribute's value of the event's source
47+
* element
48+
* <li> {@link HyperlinkEvent#getDescription() getDescription()} returns the text content of the event's
49+
* source element
50+
* <li> {@link HyperlinkEvent#getInputEvent() getInputEvent()} returns null
51+
* <li> {@link HyperlinkEvent#getSourceElement() getSourceElement()} returns null
52+
* </ul>
53+
* @throws IllegalArgumentException
54+
* if the specified event can not be converted to a hyperlink event; this is the case if
55+
* {@link #canConvertToHyperlinkEvent(Event)} returns false
3056
* @see DomEventConverter#convertToHyperlinkEvent(Event, Object)
3157
*/
32-
@SuppressWarnings("javadoc")
3358
public static HyperlinkEvent convertToHyperlinkEvent(Event domEvent, Object source)
3459
throws IllegalArgumentException {
3560

src/main/java/org/codefx/libfx/dom/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
2-
* This package provides functionality around DOM, i.e. classes from {@code org.w3c.dom}.
32
* <p>
3+
* This package provides functionality around DOM, i.e. classes from {@code org.w3c.dom}.
4+
* </p>
45
* <h2>Event Conversion</h2> The class {@link org.codefx.libfx.dom.DomEventConverter DomEventConverter} defines methods
56
* which allow the conversion of {@link org.w3c.dom.events.Event DOM Events} to {@link javax.swing.event.HyperlinkEvent
67
* HyperlinkEvents}. {@link org.codefx.libfx.dom.StaticDomEventConverter StaticDomEventConverter} gives access to the

src/main/java/org/codefx/libfx/listener/handle/ListenerHandleBuilder.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@
1919
* <p>
2020
* The {@link ListenerHandle} returned by this builder is not yet attached, i.e. it does not initially call the
2121
* functions given to {@code onAttach} or {@code onDetach}.
22+
* </p>
23+
* <h2>Example</h2>
2224
* <p>
23-
* <h2>Example</h2> A typical use looks like this:
25+
* A typical use looks like this:
2426
*
2527
* <pre>
26-
* Property<String> textProperty;
27-
* ChangeListener<String> textListener;
28+
* Property&lt;String&gt; textProperty;
29+
* ChangeListener&lt;String&gt; textListener;
2830
*
2931
* ListenerHandle textListenerHandle = ListenerHandleBuilder
3032
* .from(textProperty, textListener)
31-
* .onAttach((property, listener) -> property.addListener(listener))
32-
* .onDetach((property, listener) -> property.removeListener(listener))
33+
* .onAttach((property, listener) -&gt; property.addListener(listener))
34+
* .onDetach((property, listener) -&gt; property.removeListener(listener))
3335
* .build();
3436
* </pre>
3537
*

src/main/java/org/codefx/libfx/serialization/SerializableOptional.java

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
* The class can be used as an argument or return type for serialization-based RPC technologies like RMI.
1919
* <p>
2020
* There are three ways to use this class to serialize instances which have an optional field.
21+
* </p>
22+
* <h2>Transform On Serialization</h2>
2123
* <p>
22-
* <h2>Transform On Serialization</h2> The field can be declared as {@code transient Optional<T> optionalField}, which
23-
* will exclude it from serialization.
24+
* The field can be declared as {@code transient Optional<T> optionalField}, which will exclude it from serialization.
2425
* <p>
2526
* The class then needs to implement custom (de)serialization methods {@code writeObject} and {@code readObject}. They
2627
* must transform the {@code optionalField} to a {@code SerializableOptional} when writing the object and after reading
2728
* such an instance transform it back to an {@code Optional}.
28-
* <p>
29-
* <h3>Code Example</h3>
29+
* </p>
30+
* <h3>Example</h3>
3031
*
3132
* <pre>
3233
* private void writeObject(ObjectOutputStream out) throws IOException {
@@ -40,36 +41,42 @@
4041
*
4142
* in.defaultReadObject();
4243
* optionalField =
43-
* ((SerializableOptional<T>) in.readObject()).toOptional();
44+
* ((SerializableOptional&lt;T&gt;) in.readObject()).toOptional();
4445
* }
4546
* </pre>
47+
*
48+
* <h2>Transform On Replace</h2>
4649
* <p>
47-
* <h2>Transform On Replace</h2> If the class is serialized using the Serialization Proxy Pattern (see <i>Effective
48-
* Java, 2nd Edition</i> by Joshua Bloch, Item 78), the proxy can have an instance of {@link SerializableOptional} to
49-
* clearly denote the field as being optional.
50+
* If the class is serialized using the Serialization Proxy Pattern (see <i>Effective Java, 2nd Edition</i> by Joshua
51+
* Bloch, Item 78), the proxy can have an instance of {@link SerializableOptional} to clearly denote the field as being
52+
* optional.
5053
* <p>
5154
* In this case, the proxy needs to transform the {@code Optional} to {@code SerializableOptional} in its constructor
5255
* (using {@link SerializableOptional#fromOptional(Optional)}) and the other way in {@code readResolve()} (with
5356
* {@link SerializableOptional#asOptional()}).
57+
* </p>
58+
* <h2>Transform On Access</h2>
5459
* <p>
55-
* <h2>Transform On Access</h2> The field can be declared as {@code SerializableOptional<T> optionalField}. This will
56-
* include it in the (de)serialization process so it does not need to be customized.
60+
* The field can be declared as {@code SerializableOptional<T> optionalField}. This will include it in the
61+
* (de)serialization process so it does not need to be customized.
5762
* <p>
5863
* But methods interacting with the field need to get an {@code Optional} instead. This can easily be done by writing
5964
* the accessor methods such that they transform the field on each access.
6065
* <p>
6166
* Note that {@link #asOptional()} simply returns the {@code Optional} which with this instance was created so no
6267
* constructor needs to be invoked.
68+
* </p>
69+
* <h3>Example</h3>
6370
* <p>
64-
* <h3>Code Example</h3> Note that it is rarely useful to expose an optional field via accessor methods. Hence the
65-
* following are private and for use inside the class.
71+
* Note that it is rarely useful to expose an optional field via accessor methods. Hence the following are private and
72+
* for use inside the class.
6673
*
6774
* <pre>
68-
* private Optional<T> getOptionalField() {
75+
* private Optional&lt;T&gt; getOptionalField() {
6976
* return optionalField.asOptional();
7077
* }
7178
*
72-
* private void setOptionalField(Optional<T> optionalField) {
79+
* private void setOptionalField(Optional&lt;T&gt; optionalField) {
7380
* this.optionalField = SerializableOptional.fromOptional(optionalField);
7481
* }
7582
* </pre>

0 commit comments

Comments
 (0)