Cleaned up Javadocs

This commit is contained in:
Erik C. Thauvin 2023-11-27 14:40:18 -08:00
parent 5167ce1c81
commit 26654821bf
11 changed files with 263 additions and 10 deletions

204
.idea/intellij-javadocs-4.0.1.xml generated Normal file
View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
<LEVEL>TYPE</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PUBLIC</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
<VISIBILITY>PROTECTED</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} if an error occurs\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
* @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${return}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt;
* The constant ${element.getName()}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt;
*${name} ${typeName}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

View file

@ -6,6 +6,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES>
<excluded>

View file

@ -1,6 +1,5 @@
# [b<span style="color:orange">l</span>d](https://rife2.com/bld) Extension to Help Create [Spring Boot](https://spring.io/projects/spring-boot) Web Applications
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/1.7.3-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
@ -22,9 +21,10 @@ public void bootjar() throws Exception {
}
```
```text
```console
./bld compile bootjar
```
- [View Examples Project](https://github.com/rife2/bld-spring-boot/tree/main/examples)
To create a [Spring Boot executable Web Archive](https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#appendix.executable-jar.nested-jars.war-structure)
@ -39,9 +39,10 @@ public void bootwar() throws Exception {
}
```
```text
```console
./bld compile bootwar
```
- [View Examples Project](https://github.com/rife2/bld-spring-boot/tree/main/examples)
Please check the [BootJarOperation documentation](https://rife2.github.io/bld-spring-boot/rife/bld/extension/BootJarOperation.html#method-summary)

1
examples/.idea/.name generated Normal file
View file

@ -0,0 +1 @@
bld-spring-boot-examples

View file

@ -6,6 +6,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES>
<excluded>

17
examples/README.md Normal file
View file

@ -0,0 +1,17 @@
# Compile and Run the Web Application
```console
./bld compile run
```
# Compile and Create the Executable JAR
```console
./bld compile bootjar
```
# Compile and Create the Executable WAR
```console
./bld compile bootwar
```

View file

@ -60,13 +60,24 @@ public class SpringBootBuild extends Project {
.artifactId("bld-spring-boot")
.description("bld Extension for Spring Boot")
.url("https://github.com/rife2/bld-spring-boot")
.developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("erik@thauvin.net")
.url("https://erik.thauvin.net/"))
.license(new PublishLicense().name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
.scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-spring-boot.git")
.developerConnection("scm:git:git@github.com:rife2/bld-spring-boot.git")
.url("https://github.com/rife2/bld-spring-boot"))
.developer(
new PublishDeveloper()
.id("ethauvin")
.name("Erik C. Thauvin")
.email("erik@thauvin.net")
.url("https://erik.thauvin.net/")
)
.license(
new PublishLicense()
.name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt")
)
.scm(
new PublishScm()
.connection("scm:git:https://github.com/rife2/bld-spring-boot.git")
.developerConnection("scm:git:git@github.com:rife2/bld-spring-boot.git")
.url("https://github.com/rife2/bld-spring-boot")
)
.signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase"));
}

View file

@ -38,6 +38,7 @@ import java.util.spi.ToolProvider;
* Implements common methods used by Spring Boot operations, such as {@link BootJarOperation} and
* {@link BootWarOperation}.
*
* @param <T> the type parameter
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
*/
@ -67,6 +68,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
*
* @param directory the destination directory
* @return this operation instance
* @throws IOException if an error occurs
*/
public T destinationDirectory(File directory) throws IOException {
destinationDirectory_ = directory;
@ -80,6 +82,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
*
* @param directory the destination directory
* @return this operation instance
* @throws IOException if an error occurs
*/
public T destinationDirectory(String directory) throws IOException {
return destinationDirectory(new File(directory));
@ -111,6 +114,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
* staging directory.
*
* @param stagingDirectory the staging directory
* @throws FileUtilsErrorException if an error occurs
*/
protected void executeCopyBootLoader(File stagingDirectory) throws FileUtilsErrorException {
if (launcherLibs_.isEmpty()) {
@ -134,6 +138,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
* Part of the {@link #execute execute} operation, copies the {@code BOOT-INF} or {@code WEB-INF} classes.
*
* @param stagingInfDirectory Tte staging {@code INF} directory
* @throws IOException if an error occurs
*/
protected void executeCopyInfClassesFiles(File stagingInfDirectory) throws IOException {
var inf_classes_dir = new File(stagingInfDirectory, "classes");
@ -154,6 +159,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
* Part of the {@link #execute execute} operation, copies the {@code BOOT-INF} or (@code WEB-INF) libs.
*
* @param stagingInfDirectory the staging {@code INF} directory
* @throws IOException if an error occurs
*/
protected void executeCopyInfLibs(File stagingInfDirectory) throws IOException {
var inf_lib_dir = new File(stagingInfDirectory, "lib");
@ -173,6 +179,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
*
* @param stagingDirectory the staging directory
* @return the archive
* @throws IOException if an error occurs
*/
protected File executeCreateArchive(File stagingDirectory) throws IOException {
executeCreateManifest(stagingDirectory);
@ -223,6 +230,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
* Part of the {@link #execute execute} operation, creates the manifest for the archive.
*
* @param stagingDirectory the staging directory
* @throws IOException if an error occurs
*/
protected void executeCreateManifest(File stagingDirectory) throws IOException {
var meta_inf_dir = new File(stagingDirectory, "META-INF");
@ -242,6 +250,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
*
* @param project the project
* @return this operation instance
* @throws IOException if an error occurs
*/
public abstract T fromProject(Project project) throws IOException;
@ -323,6 +332,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
*
* @param jars a collection of Java archives
* @return this operation instance
* @throws IOException if an error occurs
*/
public T launcherLibs(Collection<File> jars) throws IOException {
if (!jars.isEmpty()) {
@ -420,6 +430,7 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
* {@link IllegalArgumentException} otherwise.
*
* @return {@code true} or an {@link IllegalArgumentException}
* @throws IllegalArgumentException if an error occurs
*/
@SuppressWarnings("SameReturnValue")
protected boolean verifyExecute() throws IllegalArgumentException {

View file

@ -66,6 +66,7 @@ public class BootJarOperation extends AbstractBootOperation<BootJarOperation> {
*
* @param stagingDirectory the staging directory
* @return the {@code BOOT-INF} directory location
* @throws IOException if an error occurs
*/
protected File executeCreateBootInfDirectory(File stagingDirectory) throws IOException {
var boot_inf = new File(stagingDirectory, "BOOT-INF");

View file

@ -38,6 +38,7 @@ public final class BootUtils {
* Deletes the given directories.
*
* @param directories one or more directories to delete
* @throws FileUtilsErrorException if an error occurs
*/
public static void deleteDirectories(File... directories) throws FileUtilsErrorException {
for (var d : directories) {
@ -68,6 +69,7 @@ public final class BootUtils {
* Makes a directory for the given path, including any necessary but nonexistent parent directories.
*
* @param path the directory path
* @throws IOException if an error occurs
*/
public static void mkDirs(File path) throws IOException {
if (!path.exists() && !path.mkdirs()) {

View file

@ -69,6 +69,7 @@ public class BootWarOperation extends AbstractBootOperation<BootWarOperation> {
* Part of the {@link #execute execute} operation, copies the {@code WEB-INF/lib-provided} libraries.
*
* @param stagingWebInfDirectory the staging {@code WEB-INF/lib-provided} directory
* @throws IOException if an error occurs
*/
protected void executeCopyWebInfProvidedLib(File stagingWebInfDirectory) throws IOException {
var lib_provided_dir = new File(stagingWebInfDirectory, "lib-provided");
@ -86,7 +87,9 @@ public class BootWarOperation extends AbstractBootOperation<BootWarOperation> {
/**
* Part of the {@link #execute execute} operation, creates the {@code WEB-INF} staging directory.
*
* @param stagingDirectory the staging directory
* @return the {@code WEB-INF} directory location
* @throws IOException if an error occurs
*/
protected File executeCreateWebInfDirectory(File stagingDirectory) throws IOException {
var boot_inf = new File(stagingDirectory, "WEB-INF");