Merge branch '8-retention-policy-source' into 'main'

Resolve "retention policy source"

Closes #8

See merge request nairah1/jackfruit!8
This commit is contained in:
Hari Nair
2022-10-02 13:45:52 +00:00
8 changed files with 26 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
## Quick start
Jackfruit processes annotations on Java interfaces and abstract classes to generate code that can read and write Apache Configuration files. The `demo` module includes sample code. In the top level directory, run `mvn clean package`, which will build the annotation library, run the annotation processor on the file `demo/src/main/java/jackfruit/demo/DemoInterface.java`, and generate the class `demo/target/generated-sources/annotations/jackfruit/demo/DemoInterfaceFactory.java`. The file `demo/src/main/java/jackfruit/demo/JackfruitDemo.java` shows some simple examples of use.
Jackfruit processes annotations on Java interfaces and abstract classes to generate code that can read and write Apache Configuration files. In the top level directory, run `mvn clean package`, which will build the annotation library in the `jackfruit` module and run the annotation processor in the `demo` module. The file `demo/src/main/java/jackfruit/demo/JackfruitDemo.java` shows some simple examples of use.
## Introduction

View File

@@ -34,5 +34,16 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* @author nairah1
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.METHOD)
public @interface Comment {
public String value() default "";

View File

@@ -16,7 +16,7 @@ import java.lang.annotation.Target;
* @author nairah1
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.METHOD)
public @interface DefaultValue {
public String value() default "";

View File

@@ -18,7 +18,7 @@ import java.lang.annotation.Target;
* @author nairah1
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Jackfruit {
public String prefix() default "";

View File

@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* @author nairah1
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.METHOD)
public @interface Key {
public String value() default "";

View File

@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* @author nairah1
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.METHOD)
public @interface ParserClass {
public Class<?> value();

View File

@@ -48,7 +48,15 @@ import jackfruit.annotations.Key;
import jackfruit.annotations.ParserClass;
/**
* https://www.javacodegeeks.com/2015/09/java-annotation-processors.html
* Useful references for writing an annotation processor:
* <ul>
* <li><a href=
* "https://www.javacodegeeks.com/2015/09/java-annotation-processors.html">https://www.javacodegeeks.com/2015/09/java-annotation-processors.html</a></li>
* <li><a href=
* "https://hannesdorfmann.com/annotation-processing/annotationprocessing101/">https://hannesdorfmann.com/annotation-processing/annotationprocessing101/</a></li>
* <li><a href=
* "http://www.javatronic.fr/articles/2014/08/31/how_to_make_sure_javac_is_using_a_specific_annotation_processor.html">http://www.javatronic.fr/articles/2014/08/31/how_to_make_sure_javac_is_using_a_specific_annotation_processor.html</a></li>
* </ul>
*
* @author nairah1
*