diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/ReporterMojo.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/ReporterMojo.java index 658c1b0..8d0e6a1 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/ReporterMojo.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/ReporterMojo.java @@ -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) { diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/ReportingService.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/ReportingService.java index 497a02e..ee65595 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/ReportingService.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/ReportingService.java @@ -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 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); } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/RepositoryService.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/RepositoryService.java index 137d239..76356f9 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/RepositoryService.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/RepositoryService.java @@ -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 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; } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/MetadataFile.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/MetadataFile.java index 559cf12..5fde5ef 100755 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/MetadataFile.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/MetadataFile.java @@ -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; } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/PropertiesFile.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/PropertiesFile.java index 57bd129..45d7586 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/PropertiesFile.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/dto/PropertiesFile.java @@ -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; } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/MetadataFileNotFoundException.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/MetadataFileNotFoundException.java index 7519ebd..e9abbab 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/MetadataFileNotFoundException.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/MetadataFileNotFoundException.java @@ -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); } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/OperationFailedException.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/OperationFailedException.java index 41a2da4..616140b 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/OperationFailedException.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/exceptions/OperationFailedException.java @@ -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); } diff --git a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/model/PropertyMetadata.java b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/model/PropertyMetadata.java index 7d5255c..47c7d91 100644 --- a/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/model/PropertyMetadata.java +++ b/spring-configuration-aggregator-maven-plugin/src/main/java/com/github/egoettelmann/spring/configuration/extensions/aggregator/maven/core/model/PropertyMetadata.java @@ -4,6 +4,9 @@ import java.util.List; +/** + * Data holder for the metadata of a property. + */ @Data public class PropertyMetadata { @@ -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 properties; diff --git a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/main/java/com/github/egoettelmann/spring/configuration/extensions/samples1/config/Sample1Properties.java b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/main/java/com/github/egoettelmann/spring/configuration/extensions/samples1/config/Sample1Properties.java index 90cf91c..7ffff44 100644 --- a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/main/java/com/github/egoettelmann/spring/configuration/extensions/samples1/config/Sample1Properties.java +++ b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/main/java/com/github/egoettelmann/spring/configuration/extensions/samples1/config/Sample1Properties.java @@ -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; diff --git a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/aggregated-spring-configuration-metadata-test-sample1.json b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/aggregated-spring-configuration-metadata-test-sample1.json index c438efd..a68312e 100644 --- a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/aggregated-spring-configuration-metadata-test-sample1.json +++ b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/aggregated-spring-configuration-metadata-test-sample1.json @@ -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" : [ { diff --git a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/report-test-sample1.json b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/report-test-sample1.json index f632bc2..b6583bf 100644 --- a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/report-test-sample1.json +++ b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/report-test-sample1.json @@ -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" : [ { diff --git a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/spring-configuration-metadata-test-sample1.json b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/spring-configuration-metadata-test-sample1.json index f873f3a..1dc5b3b 100644 --- a/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/spring-configuration-metadata-test-sample1.json +++ b/spring-configuration-extensions-samples/spring-configuration-extensions-samples1/src/test/resources/spring-configuration-metadata-test-sample1.json @@ -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 }, diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/ValueAnnotationProcessor.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/ValueAnnotationProcessor.java index 1b6ed57..be64875 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/ValueAnnotationProcessor.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/ValueAnnotationProcessor.java @@ -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 = ""; @@ -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); diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadata.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadata.java index 921d2f5..fbf0101 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadata.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadata.java @@ -1,5 +1,8 @@ package com.github.egoettelmann.spring.configuration.extensions.annotationprocessor.value.core; +/** + * Data holder for value annotation metadata + */ public class ValueAnnotationMetadata { private String name; @@ -8,42 +11,98 @@ public class ValueAnnotationMetadata { private String sourceType; private String defaultValue; + /** + * Instantiates the value annotation metadata + */ + public ValueAnnotationMetadata() { + } + + /** + * Get the name of the property. + * + * @return the name + */ public String getName() { return name; } + /** + * Set the name of the property. + * + * @param name the property name + */ public void setName(String name) { this.name = name; } + /** + * Get the type of the property. + * + * @return the property name + */ public String getType() { return type; } + /** + * Set the type of the property. + * + * @param type the property name + */ public void setType(String type) { this.type = type; } + /** + * Get the description of the property. + * + * @return the property description + */ public String getDescription() { return description; } + /** + * Set the description of the property. + * + * @param description the property description + */ public void setDescription(String description) { this.description = description; } + /** + * Get the source type of the property. + * + * @return the property source type + */ public String getSourceType() { return sourceType; } + /** + * Set the source type of the property. + * + * @param sourceType the property source type + */ public void setSourceType(String sourceType) { this.sourceType = sourceType; } + /** + * Get the default value of the property. + * + * @return the property default value + */ public String getDefaultValue() { return defaultValue; } + /** + * Set the default value of the property. + * + * @param defaultValue the property default value + */ public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadataBuilder.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadataBuilder.java index c7d70df..628a1c1 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadataBuilder.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationMetadataBuilder.java @@ -4,6 +4,9 @@ import java.util.List; import java.util.Map; +/** + * Builder for {@link ValueAnnotationMetadata}. + */ public class ValueAnnotationMetadataBuilder { private final String rawValue; @@ -11,29 +14,63 @@ public class ValueAnnotationMetadataBuilder { private String description; private String sourceType; + /** + * Instantiates the builder. + * + * @param rawValue the raw value + */ private ValueAnnotationMetadataBuilder(String rawValue) { this.rawValue = rawValue; } + /** + * Creates a builder instance. + * + * @param rawValue the raw value + * @return the builder instance + */ public static ValueAnnotationMetadataBuilder of(final String rawValue) { return new ValueAnnotationMetadataBuilder(rawValue); } + /** + * Defines the type. + * + * @param type the type + * @return the builder instance + */ public ValueAnnotationMetadataBuilder type(final String type) { this.type = type; return this; } + /** + * Defines the description. + * + * @param description the description + * @return the builder instance + */ public ValueAnnotationMetadataBuilder description(final String description) { this.description = description; return this; } + /** + * Defines the source type. + * + * @param sourceType the source type + * @return the builder instance + */ public ValueAnnotationMetadataBuilder sourceType(final String sourceType) { this.sourceType = sourceType; return this; } + /** + * Builds a list of value annotation metadata from the instance. + * + * @return the list of value annotation metadata + */ public List build() { final List results = new ArrayList<>(); diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationParser.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationParser.java index 80ae062..58f154c 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationParser.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/core/ValueAnnotationParser.java @@ -13,6 +13,12 @@ public class ValueAnnotationParser { private final String separator = ":"; private final String opposingSuffix = "{"; + /** + * Instantiates the parser + */ + public ValueAnnotationParser() { + } + /** * Parses a value and returns a map of properties found, with: * - the key being the property diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/exceptions/ValueAnnotationException.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/exceptions/ValueAnnotationException.java index 77a9518..a6603df 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/exceptions/ValueAnnotationException.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/exceptions/ValueAnnotationException.java @@ -1,11 +1,25 @@ package com.github.egoettelmann.spring.configuration.extensions.annotationprocessor.value.exceptions; +/** + * Exception thrown on annotation processing failures + */ public class ValueAnnotationException extends RuntimeException { + /** + * Instantiates the exception. + * + * @param message the exception message + */ public ValueAnnotationException(String message) { super(message); } + /** + * Instantiates the exception. + * + * @param message the exception message + * @param cause the cause + */ public ValueAnnotationException(String message, Throwable cause) { super(message, cause); } diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/reader/ElementReader.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/reader/ElementReader.java index a6b4d08..a8e20b0 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/reader/ElementReader.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/reader/ElementReader.java @@ -14,18 +14,35 @@ import java.util.Map; import java.util.Optional; +/** + * A reader class to extract the value annotation metadata from a given {@link Element}. + */ public class ElementReader { + /** + * The value annotation class to process + */ public static final String VALUE_ANNOTATION_CLASS = "org.springframework.beans.factory.annotation.Value"; private static final String VALUE_ANNOTATION_PARAM = "value"; private final Elements elementUtils; + /** + * Instantiates the reader. + * + * @param elementUtils the utils class to interact with the element context + */ public ElementReader(final Elements elementUtils) { this.elementUtils = elementUtils; } + /** + * Extracts the value annotation metadata from the given element. + * + * @param element the element to read + * @return the list of value annotation metadata + */ public List read(final Element element) { try { return ValueAnnotationMetadataBuilder.of(this.extractValue(element)) diff --git a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/writer/JsonWriter.java b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/writer/JsonWriter.java index 4422c30..93bf873 100644 --- a/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/writer/JsonWriter.java +++ b/spring-value-annotation-processor/src/main/java/com/github/egoettelmann/spring/configuration/extensions/annotationprocessor/value/writer/JsonWriter.java @@ -6,10 +6,19 @@ import java.io.Writer; import java.util.List; +/** + * Utility class to write JSON. + * This class is mainly used to prevent relying on any external dependency. + */ public class JsonWriter { private final Writer writer; + /** + * Instantiates the writer. + * + * @param writer the writer to write the output to + */ public JsonWriter(Writer writer) { this.writer = writer; } @@ -49,7 +58,14 @@ public void write(final List metadataList) { } } - public void write(final String key, final String value) throws IOException { + /** + * Naive JSON writer to prevent using any external dependency. + * + * @param key the key + * @param value the value + * @throws IOException thrown on any writing failure + */ + private void write(final String key, final String value) throws IOException { if (value == null) { this.writer.write(String.format("\"%s\": null", key)); return;