Skip to content

Commit de25054

Browse files
committed
Fix jme3-networking javadoc lint issues
1 parent e356496 commit de25054

112 files changed

Lines changed: 2709 additions & 629 deletions

File tree

Some content is hidden

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

jme3-networking/build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
dependencies {
22
api project(':jme3-core')
33
}
4-
5-
javadoc {
6-
// Disable doclint for JDK8+.
7-
if (JavaVersion.current().isJava8Compatible()){
8-
options.addStringOption('Xdoclint:none', '-quiet')
9-
}
10-
}

jme3-networking/src/main/java/com/jme3/network/AbstractMessage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,18 @@ public abstract class AbstractMessage implements Message
4444
{
4545
private transient boolean reliable = true;
4646

47+
/**
48+
* Creates a reliable message by default.
49+
*/
4750
protected AbstractMessage()
4851
{
4952
}
5053

54+
/**
55+
* Creates a message with the specified reliability.
56+
*
57+
* @param reliable true if the message should be sent reliably
58+
*/
5159
protected AbstractMessage( boolean reliable )
5260
{
5361
this.reliable = reliable;

jme3-networking/src/main/java/com/jme3/network/Client.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,38 +52,50 @@ public interface Client extends MessageConnection
5252
/**
5353
* Returns true if this client is fully connected to the
5454
* host.
55+
*
56+
* @return true if the client is connected to the server
5557
*/
5658
public boolean isConnected();
5759

5860
/**
5961
* Returns true if this client has been started and is still
6062
* running.
63+
*
64+
* @return true if the client has been started and not yet closed
6165
*/
6266
public boolean isStarted();
6367

6468
/**
6569
* Returns a unique ID for this client within the remote
6670
* server or -1 if this client isn't fully connected to the
6771
* server.
72+
*
73+
* @return the server-assigned client id, or -1 if not connected
6874
*/
6975
public int getId();
7076

7177
/**
7278
* Returns the 'game name' for servers to which this client should be able
7379
* to connect. This should match the 'game name' set on the server or this
7480
* client will be turned away.
81+
*
82+
* @return the configured game name
7583
*/
7684
public String getGameName();
7785

7886
/**
7987
* Returns the game-specific version of the server this client should
8088
* be able to connect to.
89+
*
90+
* @return the expected game protocol version
8191
*/
8292
public int getVersion();
8393

8494
/**
8595
* Returns the manager for client services. Client services extend
8696
* the functionality of the client.
97+
*
98+
* @return the client service manager
8799
*/
88100
public ClientServiceManager getServices();
89101

@@ -108,35 +120,49 @@ public interface Client extends MessageConnection
108120
/**
109121
* Adds a listener that will be notified about connection
110122
* state changes.
123+
*
124+
* @param listener the listener to add
111125
*/
112126
public void addClientStateListener( ClientStateListener listener );
113127

114128
/**
115129
* Removes a previously registered connection listener.
130+
*
131+
* @param listener the listener to remove
116132
*/
117133
public void removeClientStateListener( ClientStateListener listener );
118134

119135
/**
120136
* Adds a listener that will be notified when any message or object
121137
* is received from the server.
138+
*
139+
* @param listener the listener to add
122140
*/
123141
public void addMessageListener( MessageListener<? super Client> listener );
124142

125143
/**
126144
* Adds a listener that will be notified when messages of the specified
127145
* types are received.
146+
*
147+
* @param listener the listener to add
148+
* @param classes the message classes the listener should receive
128149
*/
129150
public void addMessageListener( MessageListener<? super Client> listener, Class... classes );
130151

131152
/**
132153
* Removes a previously registered wildcard listener. This does
133154
* not remove this listener from any type-specific registrations.
155+
*
156+
* @param listener the listener to remove
134157
*/
135158
public void removeMessageListener( MessageListener<? super Client> listener );
136159

137160
/**
138161
* Removes a previously registered type-specific listener from
139162
* the specified types.
163+
*
164+
* @param listener the listener to remove
165+
* @param classes the message classes to unregister
140166
*/
141167
public void removeMessageListener( MessageListener<? super Client> listener, Class... classes );
142168

@@ -146,13 +172,16 @@ public interface Client extends MessageConnection
146172
* is to close the connection and provide an appropriate DisconnectInfo
147173
* to any ClientStateListeners. If the application adds its own error
148174
* listeners then it must take care of closing the connection itself.
175+
*
176+
* @param listener the listener to add
149177
*/
150178
public void addErrorListener( ErrorListener<? super Client> listener );
151179

152180
/**
153181
* Removes a previously registered error listener.
182+
*
183+
* @param listener the listener to remove
154184
*/
155185
public void removeErrorListener( ErrorListener<? super Client> listener );
156186
}
157187

158-

jme3-networking/src/main/java/com/jme3/network/ClientStateListener.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public interface ClientStateListener
4444
/**
4545
* Called when the specified client is fully connected to
4646
* the remote server.
47+
*
48+
* @param c the connected client
4749
*/
4850
public void clientConnected( Client c );
4951

@@ -52,6 +54,9 @@ public interface ClientStateListener
5254
* server. If info is null then the client shut down the
5355
* connection normally, otherwise the info object contains
5456
* additional information about the disconnect.
57+
*
58+
* @param c the disconnected client
59+
* @param info extra disconnect information, or null for a normal close
5560
*/
5661
public void clientDisconnected( Client c, DisconnectInfo info );
5762

@@ -61,8 +66,20 @@ public interface ClientStateListener
6166
*/
6267
public class DisconnectInfo
6368
{
69+
/**
70+
* A human-readable reason for the disconnect, if provided.
71+
*/
6472
public String reason;
73+
/**
74+
* The underlying disconnect cause, if one is available.
75+
*/
6576
public Throwable error;
77+
78+
/**
79+
* Creates an empty disconnect information object.
80+
*/
81+
public DisconnectInfo() {
82+
}
6683

6784
@Override
6885
public String toString() {

jme3-networking/src/main/java/com/jme3/network/ConnectionListener.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ public interface ConnectionListener
4444
/**
4545
* Called when a connection has been added to the specified server and
4646
* is fully setup.
47+
*
48+
* @param server the server that accepted the connection
49+
* @param conn the newly connected client
4750
*/
4851
public void connectionAdded( Server server, HostedConnection conn );
4952

5053
/**
5154
* Called when a connection has been removed from the specified
5255
* server.
56+
*
57+
* @param server the server that removed the connection
58+
* @param conn the disconnected client
5359
*/
5460
public void connectionRemoved( Server server, HostedConnection conn );
5561
}

jme3-networking/src/main/java/com/jme3/network/ErrorListener.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@
3535
/**
3636
* Notified when errors happen on a connection.
3737
*
38+
* @param <S> the connection or endpoint type that produced the error
3839
* @version $Revision$
3940
* @author Paul Speed
4041
*/
4142
public interface ErrorListener<S>
4243
{
44+
/**
45+
* Handles an error that occurred on the specified source.
46+
*
47+
* @param source the connection or endpoint that produced the error
48+
* @param t the error that was raised
49+
*/
4350
public void handleError( S source, Throwable t );
4451
}

jme3-networking/src/main/java/com/jme3/network/Filter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
/**
3636
* Determines a true or false value for a given input.
3737
*
38+
* @param <T> the input type tested by this filter
3839
* @version $Revision$
3940
* @author Paul Speed
4041
*/
@@ -43,8 +44,10 @@ public interface Filter<T>
4344
/**
4445
* Returns true if the specified input is accepted by this
4546
* filter.
47+
*
48+
* @param input the value to test
49+
* @return true if the input is accepted
4650
*/
4751
public boolean apply( T input );
4852
}
4953

50-

jme3-networking/src/main/java/com/jme3/network/Filters.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ private Filters() {
5252
/**
5353
* Creates a filter that returns true for any value in the specified
5454
* list of values and false for all other cases.
55+
*
56+
* @param <T> the value type
57+
* @param values the accepted values
58+
* @return a membership filter for the provided values
5559
*/
5660
@SuppressWarnings("unchecked")
5761
public static <T> Filter<T> in( T... values )
@@ -62,6 +66,10 @@ public static <T> Filter<T> in( T... values )
6266
/**
6367
* Creates a filter that returns true for any value in the specified
6468
* collection and false for all other cases.
69+
*
70+
* @param <T> the value type
71+
* @param collection the accepted values
72+
* @return a membership filter for the provided collection
6573
*/
6674
public static <T> Filter<T> in( Collection<? extends T> collection )
6775
{
@@ -72,6 +80,10 @@ public static <T> Filter<T> in( Collection<? extends T> collection )
7280
* Creates a filter that returns true for any value NOT in the specified
7381
* list of values and false for all other cases. This is the equivalent
7482
* of calling not(in(values)).
83+
*
84+
* @param <T> the value type
85+
* @param values the rejected values
86+
* @return a negated membership filter for the provided values
7587
*/
7688
@SuppressWarnings("unchecked")
7789
public static <T> Filter<T> notIn( T... values )
@@ -83,6 +95,10 @@ public static <T> Filter<T> notIn( T... values )
8395
* Creates a filter that returns true for any value NOT in the specified
8496
* collection and false for all other cases. This is the equivalent
8597
* of calling not(in(collection)).
98+
*
99+
* @param <T> the value type
100+
* @param collection the rejected values
101+
* @return a negated membership filter for the provided collection
86102
*/
87103
public static <T> Filter<T> notIn( Collection<? extends T> collection )
88104
{
@@ -92,6 +108,10 @@ public static <T> Filter<T> notIn( Collection<? extends T> collection )
92108
/**
93109
* Creates a filter that returns true for inputs that are .equals()
94110
* equivalent to the specified value.
111+
*
112+
* @param <T> the value type
113+
* @param value the accepted value
114+
* @return an equality filter
95115
*/
96116
public static <T> Filter<T> equalTo( T value )
97117
{
@@ -102,6 +122,10 @@ public static <T> Filter<T> equalTo( T value )
102122
* Creates a filter that returns true for inputs that are NOT .equals()
103123
* equivalent to the specified value. This is the equivalent of calling
104124
* not(equalTo(value)).
125+
*
126+
* @param <T> the value type
127+
* @param value the rejected value
128+
* @return an inequality filter
105129
*/
106130
public static <T> Filter<T> notEqualTo( T value )
107131
{
@@ -111,6 +135,10 @@ public static <T> Filter<T> notEqualTo( T value )
111135
/**
112136
* Creates a filter that returns true when the specified delegate filter
113137
* returns false, and vice versa.
138+
*
139+
* @param <T> the value type
140+
* @param f the delegate filter
141+
* @return a negated filter
114142
*/
115143
public static <T> Filter<T> not( Filter<T> f )
116144
{
@@ -166,4 +194,3 @@ public boolean apply( T input )
166194
}
167195
}
168196

169-

jme3-networking/src/main/java/com/jme3/network/HostedConnection.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ public interface HostedConnection extends MessageConnection
4444
{
4545
/**
4646
* Returns the Server instance that is hosting this connection.
47+
*
48+
* @return the owning server
4749
*/
4850
public Server getServer();
4951

5052
/**
5153
* Returns the server-unique ID for this client.
54+
*
55+
* @return the hosted connection id
5256
*/
5357
public int getId();
5458

@@ -57,19 +61,25 @@ public interface HostedConnection extends MessageConnection
5761
* as a string. This may or may not be unique per connection depending
5862
* on the type of transport. It is provided for information and filtering
5963
* purposes.
64+
*
65+
* @return the remote address string
6066
*/
6167
public String getAddress();
6268

6369
/**
6470
* Closes and removes this connection from the server
6571
* sending the optional reason to the remote client.
72+
*
73+
* @param reason the optional disconnect reason
6674
*/
6775
public void close( String reason );
6876

6977
/**
7078
* Sets a session attribute specific to this connection. If the value
7179
* is set to null then the attribute is removed.
7280
*
81+
* @param name the attribute name
82+
* @param value the attribute value, or null to remove it
7383
* @return The previous session value for this key or null
7484
* if there was no previous value.
7585
*/
@@ -78,12 +88,18 @@ public interface HostedConnection extends MessageConnection
7888
/**
7989
* Retrieves a previously stored session attribute or
8090
* null if no such attribute exists.
91+
*
92+
* @param <T> the expected attribute type
93+
* @param name the attribute name
94+
* @return the stored attribute value, or null if none exists
8195
*/
8296
public <T> T getAttribute( String name );
8397

8498
/**
8599
* Returns a read-only set of attribute names currently stored
86100
* for this client session.
101+
*
102+
* @return the current attribute names
87103
*/
88104
public Set<String> attributeNames();
89105
}

0 commit comments

Comments
 (0)