Formats with explaning javadoc.

pull/11/head
Markus Kreth 11 months ago
parent 462fb9543b
commit d1e89a0e0f
  1. 2
      pom.xml
  2. 21
      src/main/java/de/kreth/property2java/Format.java
  3. 2
      src/main/java/de/kreth/property2java/processor/GenerateProperty2Java.java
  4. 2
      src/main/java/de/kreth/property2java/processor/GenerateResourceBundleProperty2Javas.java

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.kreth.property2java</groupId> <groupId>de.kreth.property2java</groupId>
<artifactId>PropertyToJavaGenerator</artifactId> <artifactId>PropertyToJavaGenerator</artifactId>
<version>3.0.0</version> <version>3.0.1-SNAPSHOT</version>
<properties> <properties>

@ -1,5 +1,6 @@
package de.kreth.property2java; package de.kreth.property2java;
import java.util.Properties;
import java.util.PropertyResourceBundle; import java.util.PropertyResourceBundle;
public enum Format { public enum Format {
@ -7,21 +8,25 @@ public enum Format {
/** /**
* Offers a getString(UnaryOperator resourceFunction) method to access the * Offers a getString(UnaryOperator resourceFunction) method to access the
* String value * String value
* <p>An accessor to the resource is needed, for example {@link Properties#getProperty(String)}
*/ */
WithUnaryOperatorParameter, 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 * Generates {@link PropertyResourceBundle} to offer a getText() method without
* parameters. * parameters. It is initialized automatically
* <p>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, WithInnerPropertyResourceBundle,
/** /**
* Offers a generated {@link PropertyResourceBundle} to offer a getText() method * Generates {@link Properties} to offer a getText() method
* without parameters. * without parameters. It is initialized automatically
* <p>The property file is loaded as {@link Class#getResourceAsStream(String)}
*/ */
WithInnerPropertyLoader, WithInnerPropertyLoader,
/**
* Offers a static init(UnaryOperator resourceFunction) method to offer a
* getText() method. The init method must be called before any getText() call.
*/
WithInitializer
} }

@ -15,6 +15,8 @@ import de.kreth.property2java.Format;
* muss nur die Abhängigkeit eingebunden werden und die Annotation in einer * muss nur die Abhängigkeit eingebunden werden und die Annotation in einer
* Klasse verwendet werden, in deren Package die neuen Klassen generiert werden. * Klasse verwendet werden, in deren Package die neuen Klassen generiert werden.
* *
*
*
* Für die Ausgabe der Prozessornachrichten muss folgendes im maven compiler * Für die Ausgabe der Prozessornachrichten muss folgendes im maven compiler
* konfiguriert werden: * konfiguriert werden:
* *

@ -15,7 +15,7 @@ import java.lang.annotation.Target;
*/ */
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@interface GenerateResourceBundleProperty2Javas { public @interface GenerateResourceBundleProperty2Javas {
GenerateResourceBundleProperty2Java[] value(); GenerateResourceBundleProperty2Java[] value();
} }

Loading…
Cancel
Save