diff options
Diffstat (limited to 'src/lombok/javac/handlers/PKG.java')
-rw-r--r-- | src/lombok/javac/handlers/PKG.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lombok/javac/handlers/PKG.java b/src/lombok/javac/handlers/PKG.java new file mode 100644 index 00000000..4622c3ee --- /dev/null +++ b/src/lombok/javac/handlers/PKG.java @@ -0,0 +1,34 @@ +package lombok.javac.handlers; + +import java.lang.reflect.Modifier; + +import javax.lang.model.element.Element; +import javax.lang.model.type.TypeKind; + +import lombok.AccessLevel; +import lombok.core.TransformationsUtil; + +class PKG { + static String toGetterName(Element field) { + CharSequence fieldName = field.getSimpleName(); + + boolean isBoolean = field.asType().getKind() == TypeKind.BOOLEAN; + + return TransformationsUtil.toGetterName(fieldName, isBoolean); + } + + static int toJavacModifier(AccessLevel accessLevel) { + switch ( accessLevel ) { + case MODULE: + case PACKAGE: + return 0; + default: + case PUBLIC: + return Modifier.PUBLIC; + case PRIVATE: + return Modifier.PRIVATE; + case PROTECTED: + return Modifier.PROTECTED; + } + } +} |