aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2018-07-29 16:37:54 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2018-07-29 16:37:54 +0200
commiteeab3c0021503bca69012cf71cbbfe2505be2293 (patch)
tree94774eddcc51d6148ac23aaf3ef04f6d993c4a87 /src/core/lombok/javac
parent3d432c38d0cfeb36b8e7402eca56faaafcf7bac7 (diff)
downloadlombok-eeab3c0021503bca69012cf71cbbfe2505be2293.tar.gz
lombok-eeab3c0021503bca69012cf71cbbfe2505be2293.tar.bz2
lombok-eeab3c0021503bca69012cf71cbbfe2505be2293.zip
A few upgrades for the printers used with @lombok.core.PrintAST.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/JavacASTVisitor.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/lombok/javac/JavacASTVisitor.java b/src/core/lombok/javac/JavacASTVisitor.java
index 565980f9..d4f8f731 100644
--- a/src/core/lombok/javac/JavacASTVisitor.java
+++ b/src/core/lombok/javac/JavacASTVisitor.java
@@ -149,8 +149,12 @@ public interface JavacASTVisitor {
print("</CUD>");
}
+ private String printFlags(long f) {
+ return Flags.toString(f);
+ }
+
@Override public void visitType(JavacNode node, JCClassDecl type) {
- print("<TYPE %s>", type.name);
+ print("<TYPE %s> %s", type.name, printFlags(type.mods.flags));
indent++;
if (printContent) {
print("%s", type);
@@ -185,7 +189,7 @@ public interface JavacASTVisitor {
}
@Override public void visitField(JavacNode node, JCVariableDecl field) {
- print("<FIELD %s %s>", field.vartype, field.name);
+ print("<FIELD %s %s> %s", field.vartype, field.name, printFlags(field.mods.flags));
indent++;
if (printContent) {
if (field.init != null) print("%s", field.init);
@@ -210,7 +214,7 @@ public interface JavacASTVisitor {
type = "DEFAULTCONSTRUCTOR";
} else type = "CONSTRUCTOR";
} else type = "METHOD";
- print("<%s %s> returns: %s", type, method.name, method.restype);
+ print("<%s %s> %s returns: %s", type, method.name, printFlags(method.mods.flags), method.restype);
indent++;
if (printContent) {
if (method.body == null) print("(ABSTRACT)");
@@ -230,7 +234,7 @@ public interface JavacASTVisitor {
}
@Override public void visitMethodArgument(JavacNode node, JCVariableDecl arg, JCMethodDecl method) {
- print("<METHODARG %s %s>", arg.vartype, arg.name);
+ print("<METHODARG %s %s> %s", arg.vartype, arg.name, printFlags(arg.mods.flags));
indent++;
}
@@ -244,7 +248,7 @@ public interface JavacASTVisitor {
}
@Override public void visitLocal(JavacNode node, JCVariableDecl local) {
- print("<LOCAL %s %s>", local.vartype, local.name);
+ print("<LOCAL %s %s> %s", local.vartype, local.name, printFlags(local.mods.flags));
indent++;
}