|
@@ -81,4 +81,24 @@ public class Modifiers {
|
81
|
81
|
public static boolean hasAccess(int modifiers) {
|
82
|
82
|
return (modifiers & (PRIVATE | PUBLIC | PROTECTED | INTERNAL)) > 0;
|
83
|
83
|
}
|
|
84
|
+
|
|
85
|
+ public static String describe(int modifiers) {
|
|
86
|
+ StringBuilder builder = new StringBuilder();
|
|
87
|
+ if (isPublic(modifiers)) {
|
|
88
|
+ builder.append("public");
|
|
89
|
+ } else if (isPrivate(modifiers)) {
|
|
90
|
+ builder.append("private");
|
|
91
|
+ } else if (isProtected(modifiers)) {
|
|
92
|
+ builder.append("protected");
|
|
93
|
+ }
|
|
94
|
+ if (isAbstract(modifiers)) {
|
|
95
|
+ builder.append(" abstract");
|
|
96
|
+ } else if (isFinal(modifiers)) {
|
|
97
|
+ builder.append(" final");
|
|
98
|
+ } else if (isStatic(modifiers)) {
|
|
99
|
+ builder.append(" static");
|
|
100
|
+ }
|
|
101
|
+ return builder.toString();
|
|
102
|
+ }
|
|
103
|
+
|
84
|
104
|
}
|