From 8c3b34e8512a35c81f9d7e762246472d29cd9dd8 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 19 Jul 2010 23:40:59 +0200 Subject: Added javadoc to the annotation parameters for the @Constructor annotations, and also added the suppressConstructorProperties flag. --- src/core/lombok/AllArgsConstructor.java | 21 +++++++++++++++++++++ src/core/lombok/NoArgsConstructor.java | 21 +++++++++++++++++++++ src/core/lombok/RequiredArgsConstructor.java | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) (limited to 'src/core') diff --git a/src/core/lombok/AllArgsConstructor.java b/src/core/lombok/AllArgsConstructor.java index 605dc0f2..8b3c57bc 100644 --- a/src/core/lombok/AllArgsConstructor.java +++ b/src/core/lombok/AllArgsConstructor.java @@ -33,6 +33,27 @@ import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface AllArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + */ String staticName() default ""; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + */ AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Constructors are generated with the {@link java.beans.ConstructorProperties} annotation. + * However, this annotation is new in 1.6 which means those compiling for 1.5 will need + * to set this value to true. + * + * @deprecated Java 1.5 has already been end-of-lifed. As java 1.5 loses ground this + * method will eventually be removed. + */ + @Deprecated + boolean suppressConstructorProperties() default false; } diff --git a/src/core/lombok/NoArgsConstructor.java b/src/core/lombok/NoArgsConstructor.java index 4d0424ec..392fef8b 100644 --- a/src/core/lombok/NoArgsConstructor.java +++ b/src/core/lombok/NoArgsConstructor.java @@ -36,6 +36,27 @@ import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface NoArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + */ String staticName() default ""; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + */ AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Constructors are generated with the {@link java.beans.ConstructorProperties} annotation. + * However, this annotation is new in 1.6 which means those compiling for 1.5 will need + * to set this value to true. + * + * @deprecated Java 1.5 has already been end-of-lifed. As java 1.5 loses ground this + * method will eventually be removed. + */ + @Deprecated + boolean suppressConstructorProperties() default false; } diff --git a/src/core/lombok/RequiredArgsConstructor.java b/src/core/lombok/RequiredArgsConstructor.java index c2b2605c..de45cd37 100644 --- a/src/core/lombok/RequiredArgsConstructor.java +++ b/src/core/lombok/RequiredArgsConstructor.java @@ -33,6 +33,27 @@ import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface RequiredArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + */ String staticName() default ""; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + */ AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Constructors are generated with the {@link java.beans.ConstructorProperties} annotation. + * However, this annotation is new in 1.6 which means those compiling for 1.5 will need + * to set this value to true. + * + * @deprecated Java 1.5 has already been end-of-lifed. As java 1.5 loses ground this + * method will eventually be removed. + */ + @Deprecated + boolean suppressConstructorProperties() default false; } -- cgit