Skip to content

Commit

Permalink
Improve javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
zapek committed Dec 23, 2024
1 parent 2b6f761 commit ee4ce4a
Show file tree
Hide file tree
Showing 17 changed files with 194 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ jacocoTestReport {
}
}

javadoc {
options.overview = "src/main/javadoc/overview.html"
}

dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
annotationProcessor(platform(SpringBootPlugin.BOM_COORDINATES))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2024 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xeres is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xeres. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* Chat rooms and private messaging REST controller
*/
package io.xeres.app.api.controller.chat;
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2024 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xeres is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xeres. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* Configuration related REST controller.
* <p>This is used to store and retrieve user settings.
* <p>Note: do not store anything UI related in there because the UI can
* be run separately.
*/
package io.xeres.app.api.controller.config;
23 changes: 23 additions & 0 deletions app/src/main/java/io/xeres/app/api/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2024 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xeres is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xeres. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* REST API.
*/
package io.xeres.app.api;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/**
* This package contains Spring application events.
* Spring application events.
* <b>Beware:</b> those events are <b>asynchronous</b> which means they'll run in a new thread. If you
* need a synchronous event, make sure your event implements SynchronousEvent.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/**
* Implements all PGP related functions. Used for creating the private and public PGP keys
* PGP related functions. Used for creating the private and public PGP keys
* which identify one profile, also known as a user. Locations' certificates are then signed using
* the <i>private key</i>.<p>
* The <i>public key</i> is distributed to other profiles so that they can verify the location's certificate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

/**
* Packet format for sending and receiving data.
* <p>There are 2 header formats for Packets:
* <p>Old (describing a SimplePacket):<br>
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

/**
* The pipeline process works in the following way.
* Pipeline process.
* <p>It works in the following way.
* <p>For incoming packets
* <pre>incoming bytes -> Packet -> Item -> deserialization -> service data</pre>
* <p>For outgoing packets
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/io/xeres/app/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xeres is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xeres. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* Server part.
* <p>Uses Spring Boot and a REST API.
*/
package io.xeres.app;
23 changes: 23 additions & 0 deletions app/src/main/javadoc/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
~ Copyright (c) 2024 by David Gerber - https://zapek.com
~
~ This file is part of Xeres.
~
~ Xeres is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Xeres is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Xeres. If not, see <http://www.gnu.org/licenses/>.
-->

<body>
This is the server part of Xeres. It can be run in a standalone way and be accessed from a remote
UI client.
</body>
4 changes: 4 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jacocoTestReport {
}
}

javadoc {
options.overview = "src/main/javadoc/overview.html"
}

dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
testFixturesImplementation(platform(SpringBootPlugin.BOM_COORDINATES))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ private void setOrigin(Origin origin)
this.origin = origin;
}

/**
* Checks if an argument was set by command line or environment variable.
*
* @return true if set by env var or command line
*/
public boolean isUnset()
{
return this.origin == Origin.PROPERTY;
return origin == Origin.PROPERTY;
}
}

Expand Down
22 changes: 22 additions & 0 deletions common/src/main/javadoc/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
~ Copyright (c) 2024 by David Gerber - https://zapek.com
~
~ This file is part of Xeres.
~
~ Xeres is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Xeres is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Xeres. If not, see <http://www.gnu.org/licenses/>.
-->

<body>
This is the common part of Xeres. It contains code shared between the server part and the UI part.
</body>
4 changes: 4 additions & 0 deletions ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jacocoTestReport {
}
}

javadoc {
options.overview = "src/main/javadoc/overview.html"
}

dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
implementation project(':common')
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/java/io/xeres/ui/PrimaryStageInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void onApplicationEvent(StageReadyEvent event)
}

@EventListener
public void onNetworkReadyEvent(NetworkReadyEvent event)
public void onNetworkReadyEvent(NetworkReadyEvent unused)
{
if (!StartupProperties.getBoolean(UI, true))
{
Expand Down
6 changes: 6 additions & 0 deletions ui/src/main/java/io/xeres/ui/support/util/UiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public static void showAlertError(Throwable t)
showAlertError(t, null);
}

/**
* Shows a generic alert error and allows to run an action afterwards.
*
* @param t the throwable
* @param action the action to perform after the alert has been dismissed
*/
public static void showAlertError(Throwable t, Runnable action)
{
Platform.runLater(() -> {
Expand Down
23 changes: 23 additions & 0 deletions ui/src/main/javadoc/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
~ Copyright (c) 2024 by David Gerber - https://zapek.com
~
~ This file is part of Xeres.
~
~ Xeres is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Xeres is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Xeres. If not, see <http://www.gnu.org/licenses/>.
-->

<body>
This is the UI part of Xeres. It communicates with the server using a REST API. Chat related functions
use WebSockets.
</body>

0 comments on commit ee4ce4a

Please sign in to comment.