Skip to content

Commit

Permalink
Improved Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
egoettelmann committed Jun 17, 2024
1 parent 87edbd4 commit 4cf14a0
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ public class ReporterMojo extends AbstractPluginMojo {
@Parameter()
private ChangesOptions changes;

/**
* Instantiates the reporter MOJO
*/
public ReporterMojo() {
super();
}

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (this.skip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@

import java.util.List;

/**
* The reporting service.
*/
public interface ReportingService {

/**
* Generates a report for the given list of aggregated property metadata.
*
* @param aggregate the list of metadata
* @param options the options for the change computation
* @return the report
*/
ArtifactMetadata report(final List<AggregatedPropertyMetadata> aggregate, final ChangesOptions options);

/**
* Saves the provided metadata into the given output report.
*
* @param metadata the metadata to save
* @param outputReport the output report
*/
void save(final ArtifactMetadata metadata, final OutputReport outputReport);

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,37 @@

import java.util.List;

/**
* The repository service
*/
public interface RepositoryService {

/**
* Resolves the dependencies of the given Maven artifact.
*
* @param project the Maven artifact to resolves the dependencies from
* @return the list of dependencies
* @throws OperationFailedException thrown if resolution fails
*/
List<Artifact> resolveDependencies(final MavenProject project) throws OperationFailedException;

/**
* Resolves the previous stable version of a Maven artifact.
*
* @param project the Maven artifact to resolve the version from
* @return the previous stable version
* @throws OperationFailedException thrown if resolution fails
*/
Artifact resolvePreviousStableVersion(final MavenProject project) throws OperationFailedException;

/**
* Resolves a version defined as string value for the given Maven artifact.
*
* @param project the Maven artifact to resolve the version from
* @param version the version to resolve
* @return the resolved version
* @throws OperationFailedException thrown if resolution fails
*/
Artifact resolveVersion(final MavenProject project, final String version) throws OperationFailedException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@

import lombok.Data;

/**
* Holds a reference to a metadata file
*/
@Data
public class MetadataFile {

private String path;

/**
* Instantiates the metadata file reference
*/
public MetadataFile() {
}

/**
* Instantiates the metadata file reference with a path
*
* @param path the path to the metadata file
*/
public MetadataFile(String path) {
this.path = path;
}

/**
* Set the metadata file path.
*
* @param path the path to the metadata file
*/
public void set(final String path) {
this.path = path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@

import lombok.Data;

/**
* Holds a reference to a properties file
*/
@Data
public class PropertiesFile {

private String path;

/**
* Instantiates the properties file reference
*/
public PropertiesFile() {
}

/**
* Instantiates the properties file reference with a path
*
* @param path the path to the properties file
*/
public PropertiesFile(String path) {
this.path = path;
}

/**
* Set the properties file path.
*
* @param path the path to the properties file
*/
public void set(final String path) {
this.path = path;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.github.egoettelmann.spring.configuration.extensions.aggregator.maven.core.exceptions;

/**
* Exception thrown when a metadata file reference could not be found
*/
public class MetadataFileNotFoundException extends Exception {

/**
* Instantiates the exception.
*
* @param message the exception message
*/
public MetadataFileNotFoundException(String message) {
super(message);
}

/**
* Instantiates the exception.
*
* @param message the exception message
* @param cause the cause
*/
public MetadataFileNotFoundException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.github.egoettelmann.spring.configuration.extensions.aggregator.maven.core.exceptions;

/**
* Exception thrown when a plugin operation failed
*/
public class OperationFailedException extends RuntimeException {

/**
* Instantiates the exception.
*
* @param message the message
*/
public OperationFailedException(String message) {
super(message);
}

/**
* Instantiates the exception.
*
* @param message the message
* @param cause the cause
*/
public OperationFailedException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import java.util.List;

/**
* Data holder for the metadata of a property.
*/
@Data
public class PropertyMetadata {

Expand All @@ -13,6 +16,9 @@ public class PropertyMetadata {
private Object defaultValue;
private String sourceType;

/**
* Wrapper to holder a list of metadata
*/
@Data
public static class Wrapper {
private List<PropertyMetadata> properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Sample1Properties {
private String title;

/**
* Boolean value without any default value
* Boolean value without any explicit default value
*/
private boolean bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"properties" : [ {
"name" : "sample1.app.bool",
"type" : "java.lang.Boolean",
"description" : "Boolean value without any default value",
"description" : "Boolean value without any explicit default value",
"defaultValue" : false,
"profiles" : null,
"sourceTypes" : [ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"properties" : [ {
"name" : "sample1.app.bool",
"type" : "java.lang.Boolean",
"description" : "Boolean value without any default value",
"description" : "Boolean value without any explicit default value",
"defaultValue" : false,
"profiles" : null,
"sourceTypes" : [ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"name": "sample1.app.bool",
"type": "java.lang.Boolean",
"description": "Boolean value without any default value",
"description": "Boolean value without any explicit default value",
"sourceType": "com.github.egoettelmann.spring.configuration.extensions.samples1.config.Sample1Properties",
"defaultValue": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@
import java.util.List;
import java.util.Set;

/**
* Annotation processor that collects all {@code org.springframework.beans.factory.annotation.Value}.
*/
@SupportedAnnotationTypes(ElementReader.VALUE_ANNOTATION_CLASS)
@SupportedOptions({ValueAnnotationProcessor.ARG_FAIL_ON_ERROR, ValueAnnotationProcessor.ARG_METADATA_OUTPUT_FILE})
@SupportedSourceVersion(SourceVersion.RELEASE_21)
public class ValueAnnotationProcessor extends AbstractProcessor {

/**
* The options flag to trigger build failures on processing errors.
*/
public static final String ARG_FAIL_ON_ERROR = "failOnError";

/**
* The options flag to specify a custom output file.
*/
public static final String ARG_METADATA_OUTPUT_FILE = "metadataOutputFile";

private static final String TARGET_PACKAGE = "";
Expand All @@ -34,6 +43,13 @@ public class ValueAnnotationProcessor extends AbstractProcessor {

private ElementReader elementReader;

/**
* Instantiates the processor
*/
public ValueAnnotationProcessor() {
super();
}

@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
Expand Down
Loading

0 comments on commit 4cf14a0

Please sign in to comment.