1 15 16 package javassist.bytecode; 17 18 22 public class AccessFlag { 23 public static final int PUBLIC = 0x0001; 24 public static final int PRIVATE = 0x0002; 25 public static final int PROTECTED = 0x0004; 26 public static final int STATIC = 0x0008; 27 public static final int FINAL = 0x0010; 28 public static final int SYNCHRONIZED = 0x0020; 29 public static final int VOLATILE = 0x0040; 30 public static final int BRIDGE = 0x0040; public static final int TRANSIENT = 0x0080; 32 public static final int VARARGS = 0x0080; public static final int NATIVE = 0x0100; 34 public static final int INTERFACE = 0x0200; 35 public static final int ABSTRACT = 0x0400; 36 public static final int STRICT = 0x0800; 37 public static final int SYNTHETIC = 0x1000; 38 public static final int ANNOTATION = 0x2000; 39 public static final int ENUM = 0x4000; 40 41 public static final int SUPER = 0x0020; 42 43 46 50 public static int setPublic(int accflags) { 51 return (accflags & ~(PRIVATE | PROTECTED)) | PUBLIC; 52 } 53 54 58 public static int setProtected(int accflags) { 59 return (accflags & ~(PRIVATE | PUBLIC)) | PROTECTED; 60 } 61 62 66 public static int setPrivate(int accflags) { 67 return (accflags & ~(PROTECTED | PUBLIC)) | PRIVATE; 68 } 69 70 73 public static int setPackage(int accflags) { 74 return (accflags & ~(PROTECTED | PUBLIC | PRIVATE)); 75 } 76 77 80 public static boolean isPublic(int accflags) { 81 return (accflags & PUBLIC) != 0; 82 } 83 84 87 public static boolean isProtected(int accflags) { 88 return (accflags & PROTECTED) != 0; 89 } 90 91 94 public static boolean isPrivate(int accflags) { 95 return (accflags & PRIVATE) != 0; 96 } 97 98 102 public static boolean isPackage(int accflags) { 103 return (accflags & (PROTECTED | PUBLIC | PRIVATE)) == 0; 104 } 105 106 109 public static int clear(int accflags, int clearBit) { 110 return accflags & ~clearBit; 111 } 112 113 119 public static int of(int modifier) { 120 return modifier; 121 } 122 123 129 public static int toModifier(int accflags) { 130 return accflags; 131 } 132 } 133 | Popular Tags |