Polish Javadoc

This commit is contained in:
Phillip Webb
2015-09-06 00:28:00 -07:00
parent e07df7e4c6
commit e674d751de
252 changed files with 680 additions and 348 deletions

View File

@@ -73,8 +73,8 @@ public interface Command {
/**
* Run the command.
* @param args command arguments (this will not include the command itself)
* @throws Exception if the command fails
* @return the outcome of the command
* @throws Exception if the command fails
*/
ExitStatus run(String... args) throws Exception;

View File

@@ -32,9 +32,9 @@ import org.springframework.util.StringUtils;
/**
* Main class used to run {@link Command}s.
*
* @author Phillip Webb
* @see #addCommand(Command)
* @see CommandRunner#runAndHandleErrors(String[])
* @author Phillip Webb
*/
public class CommandRunner implements Iterable<Command> {
@@ -201,8 +201,8 @@ public class CommandRunner implements Iterable<Command> {
/**
* Parse the arguments and run a suitable command.
* @param args the arguments
* @throws Exception if the command fails
* @return the outcome of the command
* @throws Exception if the command fails
*/
protected ExitStatus run(String... args) throws Exception {
if (args.length == 0) {

View File

@@ -29,6 +29,7 @@ public class HelpExample {
private final String example;
/**
* Create a new {@link HelpExample} instance.
* @param description The description (in the form "to ....")
* @param example the example
*/

View File

@@ -32,7 +32,7 @@ import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
import joptsimple.OptionSet;
/**
* {@link Command} to grab the dependencies of one or more Groovy scripts
* {@link Command} to grab the dependencies of one or more Groovy scripts.
*
* @author Andy Wilkinson
*/

View File

@@ -69,6 +69,9 @@ public class InitCommand extends OptionParsingCommand {
return examples;
}
/**
* {@link OptionHandler} for {@link InitCommand}.
*/
static class InitOptionHandler extends OptionHandler {
private final ServiceCapabilitiesReportGenerator serviceCapabilitiesReport;

View File

@@ -81,7 +81,7 @@ class InitializrService {
}
/**
* Generate a project based on the specified {@link ProjectGenerationRequest}
* Generate a project based on the specified {@link ProjectGenerationRequest}.
* @param request the generation request
* @return an entity defining the project
* @throws IOException if generation fails
@@ -166,14 +166,18 @@ class InitializrService {
}
/**
* Request the creation of the project using the specified URL
* Request the creation of the project using the specified URL.
* @param url the URL
* @return the response
*/
private CloseableHttpResponse executeProjectGenerationRequest(URI url) {
return execute(new HttpGet(url), url, "generate project");
}
/**
* Retrieves the meta-data of the service at the specified URL
* Retrieves the meta-data of the service at the specified URL.
* @param url the URL
* @return the response
*/
private CloseableHttpResponse executeInitializrMetadataRetrieval(String url) {
HttpGet request = new HttpGet(url);

View File

@@ -76,8 +76,8 @@ class ProjectGenerationRequest {
/**
* The URL of the service to use.
* @see #DEFAULT_SERVICE_URL
* @return the service URL
* @see #DEFAULT_SERVICE_URL
*/
public String getServiceUrl() {
return this.serviceUrl;
@@ -299,7 +299,7 @@ class ProjectGenerationRequest {
}
/**
* Generates the URI to use to generate a project represented by this request
* Generates the URI to use to generate a project represented by this request.
* @param metadata the metadata that describes the service
* @return the project generation URI
*/

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.cli.command.init;
import org.apache.http.entity.ContentType;
/**
* Represent the response of a {@link ProjectGenerationRequest}
* Represent the response of a {@link ProjectGenerationRequest}.
*
* @author Stephane Nicoll
* @since 1.2.0
@@ -37,7 +37,7 @@ class ProjectGenerationResponse {
}
/**
* Return the {@link ContentType} of this instance
* Return the {@link ContentType} of this instance.
* @return the content type
*/
public ContentType getContentType() {

View File

@@ -70,6 +70,9 @@ class ProjectGenerator {
/**
* Detect if the project should be extracted.
* @param request the generation request
* @param response the generation response
* @return if the project should be extracted
*/
private boolean shouldExtract(ProjectGenerationRequest request,
ProjectGenerationResponse response) {

View File

@@ -31,7 +31,7 @@ import org.springframework.boot.cli.compiler.GroovyCompiler;
import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;
/**
* A {@code DependencyResolver} implemented using Groovy's {@code @Grab}
* A {@code DependencyResolver} implemented using Groovy's {@code @Grab}.
*
* @author Dave Syer
* @author Andy Wilkinson

View File

@@ -28,7 +28,7 @@ import joptsimple.OptionSet;
import joptsimple.OptionSpec;
/**
* {@link Command} to uninstall dependencies from the CLI's lib directory
* {@link Command} to uninstall dependencies from the CLI's lib directory.
*
* @author Dave Syer
* @author Andy Wilkinson

View File

@@ -65,7 +65,7 @@ import joptsimple.OptionSet;
import joptsimple.OptionSpec;
/**
* {@link Command} to create a self-contained executable jar file from a CLI application
* {@link Command} to create a self-contained executable jar file from a CLI application.
*
* @author Andy Wilkinson
* @author Phillip Webb

View File

@@ -36,7 +36,7 @@ import org.springframework.util.AntPathMatcher;
import org.springframework.util.StringUtils;
/**
* Used to match resources for inclusion in a CLI application's jar file
* Used to match resources for inclusion in a CLI application's jar file.
*
* @author Andy Wilkinson
*/

View File

@@ -22,7 +22,7 @@ import joptsimple.OptionSpec;
/**
* An {@link OptionHandler} for commands that result in the compilation of one or more
* Groovy scripts
* Groovy scripts.
*
* @author Andy Wilkinson
* @author Dave Syer

View File

@@ -95,7 +95,7 @@ public class OptionHandler {
* Run the command using the specified parsed {@link OptionSet}.
* @param options the parsed option set
* @return an ExitStatus
* @throws Exception
* @throws Exception in case of errors
*/
protected ExitStatus run(OptionSet options) throws Exception {
if (this.closure != null) {

View File

@@ -28,7 +28,7 @@ import joptsimple.OptionSpec;
/**
* Simple adapter class to present an {@link OptionSet} as a
* {@link GroovyCompilerConfiguration}
* {@link GroovyCompilerConfiguration}.
*
* @author Andy Wilkinson
*/

View File

@@ -42,7 +42,7 @@ class AnsiString {
}
/**
* Append text with the given ANSI codes
* Append text with the given ANSI codes.
* @param text the text to append
* @param codes the ANSI codes
* @return this string

View File

@@ -65,7 +65,7 @@ public class Shell {
/**
* Create a new {@link Shell} instance.
* @throws IOException
* @throws IOException in case of I/O errors
*/
Shell() throws IOException {
attachSignalHandler();
@@ -174,7 +174,7 @@ public class Shell {
}
/**
* Final handle an interrup signal (CTRL-C)
* Final handle an interrup signal (CTRL-C).
*/
protected void handleSigInt() {
if (this.commandRunner.handleSigInt()) {

View File

@@ -27,12 +27,12 @@ package org.springframework.boot.cli.command.status;
public final class ExitStatus {
/**
* Generic "OK" exit status with zero exit code and {@literal hangup=false}
* Generic "OK" exit status with zero exit code and {@literal hangup=false}.
*/
public static ExitStatus OK = new ExitStatus(0, "OK");
/**
* Generic "not OK" exit status with non-zero exit code and {@literal hangup=true}
* Generic "not OK" exit status with non-zero exit code and {@literal hangup=true}.
*/
public static ExitStatus ERROR = new ExitStatus(-1, "ERROR", true);
@@ -43,7 +43,7 @@ public final class ExitStatus {
private final boolean hangup;
/**
* Create a new ExitStatus with an exit code and name as specified.
* Create a new {@link ExitStatus} instance.
* @param code the exit code
* @param name the name
*/
@@ -52,6 +52,7 @@ public final class ExitStatus {
}
/**
* Create a new {@link ExitStatus} instance.
* @param code the exit code
* @param name the name
* @param hangup true if it is OK for the caller to hangup
@@ -63,7 +64,7 @@ public final class ExitStatus {
}
/**
* An exit code appropriate for use in System.exit()
* An exit code appropriate for use in {@code System.exit()}.
* @return an exit code
*/
public int getCode() {
@@ -71,7 +72,7 @@ public final class ExitStatus {
}
/**
* A name describing the outcome
* A name describing the outcome.
* @return a name
*/
public String getName() {

View File

@@ -43,9 +43,9 @@ public class TestRunner {
/**
* Create a new {@link TestRunner} instance.
* @param configuration
* @param sources
* @param args
* @param configuration the configuration
* @param sources the sources
* @param args the args
*/
TestRunner(TestRunnerConfiguration configuration, String[] sources, String[] args) {
this.sources = sources.clone();

View File

@@ -38,6 +38,9 @@ import groovy.lang.GroovyClassLoader;
@Order(DependencyAutoConfigurationTransformation.ORDER)
public class DependencyAutoConfigurationTransformation implements ASTTransformation {
/**
* The order of the transformation.
*/
public static final int ORDER = DependencyManagementBomTransformation.ORDER + 100;
private final GroovyClassLoader loader;

View File

@@ -60,7 +60,7 @@ public class DependencyCustomizer {
/**
* Create a new nested {@link DependencyCustomizer}.
* @param parent
* @param parent the parent customizer
*/
protected DependencyCustomizer(DependencyCustomizer parent) {
this.loader = parent.loader;

View File

@@ -55,7 +55,7 @@ import org.springframework.core.annotation.Order;
import groovy.grape.Grape;
/**
* {@link ASTTransformation} for processing {@link DependencyManagementBom} annotations
* {@link ASTTransformation} for processing {@link DependencyManagementBom} annotations.
*
* @author Andy Wilkinson
* @since 1.3.0
@@ -63,6 +63,9 @@ import groovy.grape.Grape;
@Order(DependencyManagementBomTransformation.ORDER)
public class DependencyManagementBomTransformation extends AnnotatedNodeASTTransformation {
/**
* The order of the transformation.
*/
public static final int ORDER = Ordered.HIGHEST_PRECEDENCE;
private static final Set<String> DEPENDENCY_MANAGEMENT_BOM_ANNOTATION_NAMES = Collections

View File

@@ -42,6 +42,9 @@ import org.springframework.core.annotation.Order;
@Order(GroovyBeansTransformation.ORDER)
public class GroovyBeansTransformation implements ASTTransformation {
/**
* The order of the transformation.
*/
public static final int ORDER = DependencyManagementBomTransformation.ORDER + 200;
@Override

View File

@@ -171,8 +171,9 @@ public class GroovyCompiler {
* returned from this method.
* @param sources the sources to compile
* @return compiled classes
* @throws CompilationFailedException
* @throws IOException
* @throws CompilationFailedException in case of compilation failures
* @throws IOException in case of I/O errors
* @throws CompilationFailedException in case of compilation errors
*/
public Class<?>[] compile(String... sources) throws CompilationFailedException,
IOException {

View File

@@ -59,7 +59,7 @@ public interface GroovyCompilerConfiguration {
boolean isAutoconfigure();
/**
* Returns the classpath for local resources
* Returns the classpath for local resources.
* @return a path for local resources
*/
String[] getClasspath();

View File

@@ -47,6 +47,7 @@ public final class RepositoryConfigurationFactory {
}
/**
* Create a new default repository configuration.
* @return the newly-created default repository configuration
*/
public static List<RepositoryConfiguration> createDefaultRepositoryConfiguration() {

View File

@@ -41,6 +41,9 @@ import groovy.lang.Grab;
public class ResolveDependencyCoordinatesTransformation extends
AnnotatedNodeASTTransformation {
/**
* The order of the transformation.
*/
public static final int ORDER = DependencyManagementBomTransformation.ORDER + 300;
private static final Set<String> GRAB_ANNOTATION_NAMES = Collections

View File

@@ -20,7 +20,7 @@ import org.codehaus.groovy.transform.ASTTransformation;
/**
* Marker interface for AST transformations that should be installed automatically from
* META-INF/services
* {@code META-INF/services}.
*
* @author Dave Syer
*/

View File

@@ -24,7 +24,7 @@ import org.springframework.boot.cli.compiler.CompilerAutoConfiguration;
import org.springframework.boot.cli.compiler.DependencyCustomizer;
/**
* {@link CompilerAutoConfiguration} for JUnit
* {@link CompilerAutoConfiguration} for JUnit.
*
* @author Greg Turnquist
*/

View File

@@ -24,7 +24,7 @@ import org.springframework.boot.cli.compiler.CompilerAutoConfiguration;
import org.springframework.boot.cli.compiler.DependencyCustomizer;
/**
* {@link CompilerAutoConfiguration} for Spock test framework
* {@link CompilerAutoConfiguration} for Spock test framework.
*
* @author Greg Turnquist
*/

View File

@@ -32,7 +32,7 @@ import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;
import groovy.lang.GroovyClassLoader;
/**
* {@link CompilerAutoConfiguration} for Spring Test
* {@link CompilerAutoConfiguration} for Spring Test.
*
* @author Dave Syer
* @since 1.1.0

View File

@@ -22,7 +22,7 @@ import java.util.List;
/**
* {@link DependencyManagement} that delegates to one or more {@link DependencyManagement}
* instances
* instances.
*
* @author Andy Wilkinson
* @since 1.3.0

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.cli.compiler.dependencies;
import java.util.List;
/**
* An encapsulation of dependency management information
* An encapsulation of dependency management information.
*
* @author Andy Wilkinson
* @since 1.3.0

View File

@@ -25,7 +25,7 @@ import org.apache.maven.model.Model;
import org.springframework.boot.cli.compiler.dependencies.Dependency.Exclusion;
/**
* {@link DependencyManagement} derived from a Maven {@link Model}
* {@link DependencyManagement} derived from a Maven {@link Model}.
*
* @author Andy Wilkinson
* @since 1.3.0

View File

@@ -24,7 +24,8 @@ import org.apache.maven.model.io.DefaultModelReader;
import org.apache.maven.model.locator.DefaultModelLocator;
/**
* {@link DependencyManagement} derived from the effective pom of spring-boot-dependencies
* {@link DependencyManagement} derived from the effective pom of
* {@code spring-boot-dependencies}.
*
* @author Andy Wilkinson
* @since 1.3.0

View File

@@ -17,15 +17,15 @@
package org.springframework.boot.cli.compiler.grape;
/**
* Reports progress on a dependency resolution operation
* Reports progress on a dependency resolution operation.
*
* @author Andy Wilkinson
*/
interface ProgressReporter {
/**
* Notification that the operation has completed
* Notification that the operation has completed.
*/
void finished();
}
}

View File

@@ -21,7 +21,7 @@ import java.net.URI;
import org.springframework.util.ObjectUtils;
/**
* The configuration of a repository
* The configuration of a repository.
*
* @author Andy Wilkinson
*/
@@ -47,7 +47,8 @@ public final class RepositoryConfiguration {
}
/**
* @return the name of the repository
* Return the name of the repository.
* @return the repository name
*/
public String getName() {
return this.name;
@@ -60,15 +61,16 @@ public final class RepositoryConfiguration {
}
/**
* @return the uri of the repository
* Return the URI of the repository.
* @return the repository URI
*/
public URI getUri() {
return this.uri;
}
/**
* @return {@code true} if the repository should enable access to snapshots,
* {@code false} otherwise
* Return if the repository should enable access to snapshots.
* @return {@code true} if snapshot access is enabled
*/
public boolean getSnapshotsEnabled() {
return this.snapshotsEnabled;

View File

@@ -28,7 +28,7 @@ import org.eclipse.aether.RepositorySystem;
public interface RepositorySystemSessionAutoConfiguration {
/**
* Apply the configuration
* Apply the configuration.
* @param session the repository system session
* @param repositorySystem the repository system
*/

View File

@@ -24,7 +24,7 @@ import org.springframework.boot.cli.compiler.MavenSettingsReader;
/**
* Auto-configuration for a RepositorySystemSession that uses Maven's settings.xml to
* determine the configuration settings
* determine the configuration settings.
*
* @author Andy Wilkinson
*/

View File

@@ -32,8 +32,14 @@ import org.springframework.boot.cli.app.SpringApplicationLauncher;
*/
public final class PackagedSpringApplicationLauncher {
/**
* The entry containing the source class.
*/
public static final String SOURCE_ENTRY = "Spring-Application-Source-Classes";
/**
* The entry containing the start class.
*/
public static final String START_CLASS_ENTRY = "Start-Class";
private PackagedSpringApplicationLauncher() {

View File

@@ -43,17 +43,17 @@ import org.springframework.util.StringUtils;
public abstract class ResourceUtils {
/**
* Pseudo URL prefix for loading from the class path: "classpath:"
* Pseudo URL prefix for loading from the class path: "classpath:".
*/
public static final String CLASSPATH_URL_PREFIX = "classpath:";
/**
* Pseudo URL prefix for loading all resources from the class path: "classpath*:"
* Pseudo URL prefix for loading all resources from the class path: "classpath*:".
*/
public static final String ALL_CLASSPATH_URL_PREFIX = "classpath*:";
/**
* URL prefix for loading from the file system: "file:"
* URL prefix for loading from the file system: "file:".
*/
public static final String FILE_URL_PREFIX = "file:";

View File

@@ -26,6 +26,8 @@ import org.springframework.boot.cli.compiler.autoconfigure.SpringMobileCompilerA
/**
* Pseudo annotation used to trigger {@link SpringMobileCompilerAutoConfiguration}.
*
* @author Phillip Webb
*/
@Target(ElementType.TYPE)
@Documented