return false;
}
+ /**
+ * Determines whether this object represents an annotation type.
+ * It returns <code>true</code> if this object represents an annotation type.
+ */
+ public boolean isAnnotation() {
+ return false;
+ }
+
+ /**
+ * Determines whether this object represents an enum.
+ * It returns <code>true</code> if this object represents an enum.
+ */
+ public boolean isEnum() {
+ return false;
+ }
+
/**
* Returns the modifiers for this class, encoded in an integer.
* For decoding, use <code>javassist.Modifier</code>.
return Modifier.isInterface(getModifiers());
}
+ public boolean isAnnotation() {
+ return Modifier.isAnnotation(getModifiers());
+ }
+
+ public boolean isEnum() {
+ return Modifier.isEnum(getModifiers());
+ }
+
public int getModifiers() {
ClassFile cf = getClassFile2();
int acc = cf.getAccessFlags();
return (mod & INTERFACE) != 0;
}
+ /**
+ * Returns true if the modifiers include the <tt>annotation</tt>
+ * modifier.
+ */
+ public static boolean isAnnotation(int mod) {
+ return (mod & ANNOTATION) != 0;
+ }
+
+ /**
+ * Returns true if the modifiers include the <tt>enum</tt>
+ * modifier.
+ */
+ public static boolean isEnum(int mod) {
+ return (mod & ENUM) != 0;
+ }
+
/**
* Returns true if the modifiers include the <tt>abstract</tt>
* modifier.