Lombok - v0.11.0

lombok.core
Class TransformationsUtil

java.lang.Object
  extended by lombok.core.TransformationsUtil

public class TransformationsUtil
extends Object

Container for static utility methods useful for some of the standard lombok transformations, regardless of target platform (e.g. useful for both javac and Eclipse lombok implementations).


Field Summary
static Pattern NON_NULL_PATTERN
          Matches the simple part of any annotation that lombok considers as indicative of NonNull status.
static Pattern NULLABLE_PATTERN
          Matches the simple part of any annotation that lombok considers as indicative of Nullable status.
 
Method Summary
static List<String> toAllGetterNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
          Returns all names of methods that would represent the getter for a field with the provided name.
static List<String> toAllSetterNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
          Returns all names of methods that would represent the setter for a field with the provided name.
static String toGetterName(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
          Generates a getter name from a given field name.
static String toSetterName(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
          Generates a setter name from a given field name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NON_NULL_PATTERN

public static final Pattern NON_NULL_PATTERN
Matches the simple part of any annotation that lombok considers as indicative of NonNull status.


NULLABLE_PATTERN

public static final Pattern NULLABLE_PATTERN
Matches the simple part of any annotation that lombok considers as indicative of Nullable status.

Method Detail

toGetterName

public static String toGetterName(AnnotationValues<Accessors> accessors,
                                  CharSequence fieldName,
                                  boolean isBoolean)
Generates a getter name from a given field name. Strategy:

Parameters:
accessors - Accessors configuration.
fieldName - the name of the field.
isBoolean - if the field is of type 'boolean'. For fields of type java.lang.Boolean, you should provide false.
Returns:
The getter name for this field, or null if this field does not fit expected patterns and therefore cannot be turned into a getter name.

toSetterName

public static String toSetterName(AnnotationValues<Accessors> accessors,
                                  CharSequence fieldName,
                                  boolean isBoolean)
Generates a setter name from a given field name. Strategy:

Parameters:
accessors - Accessors configuration.
fieldName - the name of the field.
isBoolean - if the field is of type 'boolean'. For fields of type java.lang.Boolean, you should provide false.
Returns:
The setter name for this field, or null if this field does not fit expected patterns and therefore cannot be turned into a getter name.

toAllGetterNames

public static List<String> toAllGetterNames(AnnotationValues<Accessors> accessors,
                                            CharSequence fieldName,
                                            boolean isBoolean)
Returns all names of methods that would represent the getter for a field with the provided name. For example if isBoolean is true, then a field named isRunning would produce:
[isRunning, getRunning, isIsRunning, getIsRunning]

Parameters:
accessors - Accessors configuration.
fieldName - the name of the field.
isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.

toAllSetterNames

public static List<String> toAllSetterNames(AnnotationValues<Accessors> accessors,
                                            CharSequence fieldName,
                                            boolean isBoolean)
Returns all names of methods that would represent the setter for a field with the provided name. For example if isBoolean is true, then a field named isRunning would produce:
[setRunning, setIsRunning]

Parameters:
fieldName - the name of the field.
isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.

Lombok - v0.11.0

Copyright © 2009-2011 The Project Lombok Authors, licensed under the MIT licence.