Save This Page
Home » openjdk-7 » java » lang » reflect » [javadoc | source]
java.lang.reflect
public class: Modifier [javadoc | source]
java.lang.Object
   java.lang.reflect.Modifier
The Modifier class provides {@code static} methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of The Java™ Virtual Machine Specification.
Field Summary
public static final  int PUBLIC    The {@code int} value representing the {@code public} modifier. 
public static final  int PRIVATE    The {@code int} value representing the {@code private} modifier. 
public static final  int PROTECTED    The {@code int} value representing the {@code protected} modifier. 
public static final  int STATIC    The {@code int} value representing the {@code static} modifier. 
public static final  int FINAL    The {@code int} value representing the {@code final} modifier. 
public static final  int SYNCHRONIZED    The {@code int} value representing the {@code synchronized} modifier. 
public static final  int VOLATILE    The {@code int} value representing the {@code volatile} modifier. 
public static final  int TRANSIENT    The {@code int} value representing the {@code transient} modifier. 
public static final  int NATIVE    The {@code int} value representing the {@code native} modifier. 
public static final  int INTERFACE    The {@code int} value representing the {@code interface} modifier. 
public static final  int ABSTRACT    The {@code int} value representing the {@code abstract} modifier. 
public static final  int STRICT    The {@code int} value representing the {@code strictfp} modifier. 
static final  int BRIDGE     
static final  int VARARGS     
static final  int SYNTHETIC     
static final  int ANNOTATION     
static final  int ENUM     
Method from java.lang.reflect.Modifier Summary:
classModifiers,   constructorModifiers,   fieldModifiers,   interfaceModifiers,   isAbstract,   isFinal,   isInterface,   isNative,   isPrivate,   isProtected,   isPublic,   isStatic,   isStrict,   isSynchronized,   isSynthetic,   isTransient,   isVolatile,   methodModifiers,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.reflect.Modifier Detail:
 public static int classModifiers() 
    Return an {@code int} value OR-ing together the source language modifiers that can be applied to a class.
 public static int constructorModifiers() 
    Return an {@code int} value OR-ing together the source language modifiers that can be applied to a constructor.
 public static int fieldModifiers() 
    Return an {@code int} value OR-ing together the source language modifiers that can be applied to a field.
 public static int interfaceModifiers() 
    Return an {@code int} value OR-ing together the source language modifiers that can be applied to an interface.
 public static boolean isAbstract(int mod) 
    Return {@code true} if the integer argument includes the {@code abstract} modifier, {@code false} otherwise.
 public static boolean isFinal(int mod) 
    Return {@code true} if the integer argument includes the {@code final} modifier, {@code false} otherwise.
 public static boolean isInterface(int mod) 
    Return {@code true} if the integer argument includes the {@code interface} modifier, {@code false} otherwise.
 public static boolean isNative(int mod) 
    Return {@code true} if the integer argument includes the {@code native} modifier, {@code false} otherwise.
 public static boolean isPrivate(int mod) 
    Return {@code true} if the integer argument includes the {@code private} modifier, {@code false} otherwise.
 public static boolean isProtected(int mod) 
    Return {@code true} if the integer argument includes the {@code protected} modifier, {@code false} otherwise.
 public static boolean isPublic(int mod) 
    Return {@code true} if the integer argument includes the {@code public} modifier, {@code false} otherwise.
 public static boolean isStatic(int mod) 
    Return {@code true} if the integer argument includes the {@code static} modifier, {@code false} otherwise.
 public static boolean isStrict(int mod) 
    Return {@code true} if the integer argument includes the {@code strictfp} modifier, {@code false} otherwise.
 public static boolean isSynchronized(int mod) 
    Return {@code true} if the integer argument includes the {@code synchronized} modifier, {@code false} otherwise.
 static boolean isSynthetic(int mod) 
 public static boolean isTransient(int mod) 
    Return {@code true} if the integer argument includes the {@code transient} modifier, {@code false} otherwise.
 public static boolean isVolatile(int mod) 
    Return {@code true} if the integer argument includes the {@code volatile} modifier, {@code false} otherwise.
 public static int methodModifiers() 
    Return an {@code int} value OR-ing together the source language modifiers that can be applied to a method.
 public static 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 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1 of The Java™ Language Specification. The full modifier ordering used by this method is:
    {@code public protected private abstract static final transient volatile synchronized native strictfp interface }
    The {@code 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. Note that to perform such checking for a known kind of entity, such as a constructor or method, first AND the argument of {@code toString} with the appropriate mask from a method like #constructorModifiers or #methodModifiers .