diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-07-12 02:58:26 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-07-12 02:58:26 +0200 |
commit | 3cf9ffed29cfe56734570b1c3c57d924ac7416df (patch) | |
tree | d7a9a68e89ccf4af2bf52ad4b90f0c2dc0d6de9b /src/core/lombok/eclipse | |
parent | 1865bd7309b9d1dc743f83ccdbd7204fb0939ecd (diff) | |
download | lombok-3cf9ffed29cfe56734570b1c3c57d924ac7416df.tar.gz lombok-3cf9ffed29cfe56734570b1c3c57d924ac7416df.tar.bz2 lombok-3cf9ffed29cfe56734570b1c3c57d924ac7416df.zip |
Wither support + tests (javac only; ecj tests are currently set to ignore).
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 7120a602..f9bb18b1 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -945,10 +945,7 @@ public class EclipseHandlerUtil { * Convenient wrapper around {@link TransformationsUtil#toAllGetterNames(lombok.core.AnnotationValues, CharSequence, boolean)}. */ public static List<String> toAllGetterNames(EclipseNode field, boolean isBoolean) { - String fieldName = field.getName(); - AnnotationValues<Accessors> accessors = getAccessorsForField(field); - - return TransformationsUtil.toAllGetterNames(accessors, fieldName, isBoolean); + return TransformationsUtil.toAllGetterNames(getAccessorsForField(field), field.getName(), isBoolean); } /** @@ -957,10 +954,7 @@ public class EclipseHandlerUtil { * Convenient wrapper around {@link TransformationsUtil#toGetterName(lombok.core.AnnotationValues, CharSequence, boolean)}. */ public static String toGetterName(EclipseNode field, boolean isBoolean) { - String fieldName = field.getName(); - AnnotationValues<Accessors> accessors = EclipseHandlerUtil.getAccessorsForField(field); - - return TransformationsUtil.toGetterName(accessors, fieldName, isBoolean); + return TransformationsUtil.toGetterName(getAccessorsForField(field), field.getName(), isBoolean); } /** @@ -968,10 +962,7 @@ public class EclipseHandlerUtil { * Convenient wrapper around {@link TransformationsUtil#toAllSetterNames(lombok.core.AnnotationValues, CharSequence, boolean)}. */ public static java.util.List<String> toAllSetterNames(EclipseNode field, boolean isBoolean) { - String fieldName = field.getName(); - AnnotationValues<Accessors> accessors = EclipseHandlerUtil.getAccessorsForField(field); - - return TransformationsUtil.toAllSetterNames(accessors, fieldName, isBoolean); + return TransformationsUtil.toAllSetterNames(getAccessorsForField(field), field.getName(), isBoolean); } /** @@ -980,10 +971,24 @@ public class EclipseHandlerUtil { * Convenient wrapper around {@link TransformationsUtil#toSetterName(lombok.core.AnnotationValues, CharSequence, boolean)}. */ public static String toSetterName(EclipseNode field, boolean isBoolean) { - String fieldName = field.getName(); - AnnotationValues<Accessors> accessors = EclipseHandlerUtil.getAccessorsForField(field); - - return TransformationsUtil.toSetterName(accessors, fieldName, isBoolean); + return TransformationsUtil.toSetterName(getAccessorsForField(field), field.getName(), isBoolean); + } + + /** + * Translates the given field into all possible wither names. + * Convenient wrapper around {@link TransformationsUtil#toAllWitherNames(lombok.core.AnnotationValues, CharSequence, boolean)}. + */ + public static java.util.List<String> toAllWitherNames(EclipseNode field, boolean isBoolean) { + return TransformationsUtil.toAllWitherNames(getAccessorsForField(field), field.getName(), isBoolean); + } + + /** + * @return the likely wither name for the stated field. (e.g. private boolean foo; to withFoo). + * + * Convenient wrapper around {@link TransformationsUtil#toWitherName(lombok.core.AnnotationValues, CharSequence, boolean)}. + */ + public static String toWitherName(EclipseNode field, boolean isBoolean) { + return TransformationsUtil.toWitherName(getAccessorsForField(field), field.getName(), isBoolean); } /** |