Fields Summary |
---|
public static final int | PUBLICThe int value representing the public
modifier. |
public static final int | PRIVATEThe int value representing the private
modifier. |
public static final int | PROTECTEDThe int value representing the protected
modifier. |
public static final int | STATICThe int value representing the static
modifier. |
public static final int | FINALThe int value representing the final
modifier. |
public static final int | SYNCHRONIZEDThe int value representing the synchronized
modifier. |
public static final int | VOLATILEThe int value representing the volatile
modifier. |
public static final int | TRANSIENTThe int value representing the transient
modifier. |
public static final int | NATIVEThe int value representing the native
modifier. |
public static final int | INTERFACEThe int value representing the interface
modifier. |
public static final int | ABSTRACTThe int value representing the abstract
modifier. |
public static final int | STRICTThe int value representing the strictfp
modifier. |
static final int | BRIDGE |
static final int | VARARGS |
static final int | SYNTHETIC |
static final int | ANNOTATION |
static final int | ENUM |
Methods Summary |
---|
public static boolean | isAbstract(int mod)Return true if the integer argument includes the
abstract modifier, false otherwise.
return (mod & ABSTRACT) != 0;
|
public static boolean | isFinal(int mod)Return true if the integer argument includes the
final modifier, false otherwise.
return (mod & FINAL) != 0;
|
public static boolean | isInterface(int mod)Return true if the integer argument includes the
interface modifier, false otherwise.
return (mod & INTERFACE) != 0;
|
public static boolean | isNative(int mod)Return true if the integer argument includes the
native modifier, false otherwise.
return (mod & NATIVE) != 0;
|
public static boolean | isPrivate(int mod)Return true if the integer argument includes the
private modifier, false otherwise.
return (mod & PRIVATE) != 0;
|
public static boolean | isProtected(int mod)Return true if the integer argument includes the
protected modifier, false otherwise.
return (mod & PROTECTED) != 0;
|
public static boolean | isPublic(int mod)Return true if the integer argument includes the
public modifier, false otherwise.
sun.reflect.ReflectionFactory factory =
(sun.reflect.ReflectionFactory) AccessController.doPrivileged(
new ReflectionFactory.GetReflectionFactoryAction()
);
factory.setLangReflectAccess(new java.lang.reflect.ReflectAccess());
return (mod & PUBLIC) != 0;
|
public static boolean | isStatic(int mod)Return true if the integer argument includes the
static modifier, false otherwise.
return (mod & STATIC) != 0;
|
public static boolean | isStrict(int mod)Return true if the integer argument includes the
strictfp modifier, false otherwise.
return (mod & STRICT) != 0;
|
public static boolean | isSynchronized(int mod)Return true if the integer argument includes the
synchronized modifier, false otherwise.
return (mod & SYNCHRONIZED) != 0;
|
static boolean | isSynthetic(int mod)
return (mod & SYNTHETIC) != 0;
|
public static boolean | isTransient(int mod)Return true if the integer argument includes the
transient modifier, false otherwise.
return (mod & TRANSIENT) != 0;
|
public static boolean | isVolatile(int mod)Return true if the integer argument includes the
volatile modifier, false otherwise.
return (mod & VOLATILE) != 0;
|
public static java.lang.String | toString(int mod)Return a string describing the access modifier flags in
the specified modifier. For example:
public final synchronized strictfp
The modifier names are returned in an order consistent with the
suggested modifier orderings given in The
Java Language Specification, Second Edition sections
§8.1.1,
§8.3.1,
§8.4.3,
§8.8.3, and
§9.1.1.
The full modifier ordering used by this method is:
public protected private abstract static final transient
volatile synchronized native strictfp
interface
The interface modifier discussed in this class is
not a true modifier in the Java language and it appears after
all other modifiers listed by this method. This method may
return a string of modifiers that are not valid modifiers of a
Java entity; in other words, no checking is done on the
possible validity of the combination of modifiers represented
by the input.
StringBuffer sb = new StringBuffer();
int len;
if ((mod & PUBLIC) != 0) sb.append("public ");
if ((mod & PROTECTED) != 0) sb.append("protected ");
if ((mod & PRIVATE) != 0) sb.append("private ");
/* Canonical order */
if ((mod & ABSTRACT) != 0) sb.append("abstract ");
if ((mod & STATIC) != 0) sb.append("static ");
if ((mod & FINAL) != 0) sb.append("final ");
if ((mod & TRANSIENT) != 0) sb.append("transient ");
if ((mod & VOLATILE) != 0) sb.append("volatile ");
if ((mod & SYNCHRONIZED) != 0) sb.append("synchronized ");
if ((mod & NATIVE) != 0) sb.append("native ");
if ((mod & STRICT) != 0) sb.append("strictfp ");
if ((mod & INTERFACE) != 0) sb.append("interface ");
if ((len = sb.length()) > 0) /* trim trailing space */
return sb.toString().substring(0, len-1);
return "";
|