From d1e89a0e0fbf94320b62557744ca9ff3b0e918a5 Mon Sep 17 00:00:00 2001 From: Markus Kreth Date: Sat, 25 Jan 2025 21:55:58 +0100 Subject: [PATCH] Formats with explaning javadoc. --- pom.xml | 2 +- .../java/de/kreth/property2java/Format.java | 21 ++++++++++++------- .../processor/GenerateProperty2Java.java | 2 ++ .../GenerateResourceBundleProperty2Javas.java | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index d2c9611..7bd865f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 de.kreth.property2java PropertyToJavaGenerator - 3.0.0 + 3.0.1-SNAPSHOT diff --git a/src/main/java/de/kreth/property2java/Format.java b/src/main/java/de/kreth/property2java/Format.java index c6b9638..cfeeb8a 100644 --- a/src/main/java/de/kreth/property2java/Format.java +++ b/src/main/java/de/kreth/property2java/Format.java @@ -1,5 +1,6 @@ package de.kreth.property2java; +import java.util.Properties; import java.util.PropertyResourceBundle; public enum Format { @@ -7,21 +8,25 @@ public enum Format { /** * Offers a getString(UnaryOperator resourceFunction) method to access the * String value + *

An accessor to the resource is needed, for example {@link Properties#getProperty(String)} */ WithUnaryOperatorParameter, + /** + * Offers a static init(UnaryOperator resourceFunction) method to offer a + * getText() method. The init method must be called before any getText() call. + */ + WithInitializer, /** * Generates {@link PropertyResourceBundle} to offer a getText() method without - * parameters. + * parameters. It is initialized automatically + *

The generated class supports localized property files by using {@link java.util.ResourceBundle} + * @see {@link java.util.ResourceBundle} for supported format and file names. */ WithInnerPropertyResourceBundle, /** - * Offers a generated {@link PropertyResourceBundle} to offer a getText() method - * without parameters. + * Generates {@link Properties} to offer a getText() method + * without parameters. It is initialized automatically + *

The property file is loaded as {@link Class#getResourceAsStream(String)} */ WithInnerPropertyLoader, - /** - * Offers a static init(UnaryOperator resourceFunction) method to offer a - * getText() method. The init method must be called before any getText() call. - */ - WithInitializer } diff --git a/src/main/java/de/kreth/property2java/processor/GenerateProperty2Java.java b/src/main/java/de/kreth/property2java/processor/GenerateProperty2Java.java index 8291a26..1d0d49c 100644 --- a/src/main/java/de/kreth/property2java/processor/GenerateProperty2Java.java +++ b/src/main/java/de/kreth/property2java/processor/GenerateProperty2Java.java @@ -15,6 +15,8 @@ import de.kreth.property2java.Format; * muss nur die Abhängigkeit eingebunden werden und die Annotation in einer * Klasse verwendet werden, in deren Package die neuen Klassen generiert werden. * + * + * * Für die Ausgabe der Prozessornachrichten muss folgendes im maven compiler * konfiguriert werden: * diff --git a/src/main/java/de/kreth/property2java/processor/GenerateResourceBundleProperty2Javas.java b/src/main/java/de/kreth/property2java/processor/GenerateResourceBundleProperty2Javas.java index 84af0bf..f68a0dc 100644 --- a/src/main/java/de/kreth/property2java/processor/GenerateResourceBundleProperty2Javas.java +++ b/src/main/java/de/kreth/property2java/processor/GenerateResourceBundleProperty2Javas.java @@ -15,7 +15,7 @@ import java.lang.annotation.Target; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@interface GenerateResourceBundleProperty2Javas { +public @interface GenerateResourceBundleProperty2Javas { GenerateResourceBundleProperty2Java[] value(); }