Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 1 | package aQute.bnd.compatibility; |
| 2 | |
| 3 | import java.lang.reflect.*; |
| 4 | |
| 5 | /** |
| 6 | * Access modifier |
| 7 | */ |
| 8 | public enum Access { |
| 9 | PUBLIC, PROTECTED, PACKAGE, PRIVATE, UNKNOWN; |
| 10 | |
| 11 | public static Access modifier(int mod) { |
| 12 | if (Modifier.isPublic(mod)) |
| 13 | return PUBLIC; |
| 14 | if (Modifier.isProtected(mod)) |
| 15 | return PROTECTED; |
| 16 | if (Modifier.isPrivate(mod)) |
| 17 | return PRIVATE; |
| 18 | |
| 19 | return PACKAGE; |
| 20 | } |
| 21 | |
| 22 | public String toString() { |
| 23 | return super.toString().toLowerCase(); |
| 24 | } |
| 25 | } |