Package Summary  Overview Summary

class:Modifier [NONE]


public class Modifierextends Object
The Modifier class provides 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 .
Since:
1.1
See Also:

field:PUBLIC [CHANGED]

  • PUBLIC

    public static final  int PUBLIC
    The int value representing the public modifier.
    See Also:
  • PUBLIC

    public static final  int PUBLIC
    The int value representing the public modifier.
    See Also:
  • PUBLIC

    public static final  int PUBLIC
    The int value representing the public modifier.
    See Also:
  • field:PRIVATE [CHANGED]

    PRIVATE

    public static final  int PRIVATE
    The int value representing the private modifier.
    See Also:

    PRIVATE

    public static final  int PRIVATE
    The int value representing the private modifier.
    See Also:

    PRIVATE

    public static final  int PRIVATE
    The int value representing the private modifier.
    See Also:

    field:PROTECTED [CHANGED]

    PROTECTED

    public static final  int PROTECTED
    The int value representing the protected modifier.
    See Also:

    PROTECTED

    public static final  int PROTECTED
    The int value representing the protected modifier.
    See Also:

    PROTECTED

    public static final  int PROTECTED
    The int value representing the protected modifier.
    See Also:

    field:STATIC [CHANGED]

    STATIC

    public static final  int STATIC
    The int value representing the static modifier.
    See Also:

    STATIC

    public static final  int STATIC
    The int value representing the static modifier.
    See Also:

    STATIC

    public static final  int STATIC
    The int value representing the static modifier.
    See Also:

    field:FINAL [CHANGED]

    FINAL

    public static final  int FINAL
    The int value representing the final modifier.
    See Also:

    FINAL

    public static final  int FINAL
    The int value representing the final modifier.
    See Also:

    FINAL

    public static final  int FINAL
    The int value representing the final modifier.
    See Also:

    field:SYNCHRONIZED [CHANGED]

    SYNCHRONIZED

    public static final  int SYNCHRONIZED
    The int value representing the synchronized modifier.
    See Also:

    SYNCHRONIZED

    public static final  int SYNCHRONIZED
    The int value representing the synchronized modifier.
    See Also:

    SYNCHRONIZED

    public static final  int SYNCHRONIZED
    The int value representing the synchronized modifier.
    See Also:

    field:VOLATILE [CHANGED]

    VOLATILE

    public static final  int VOLATILE
    The int value representing the volatile modifier.
    See Also:

    VOLATILE

    public static final  int VOLATILE
    The int value representing the volatile modifier.
    See Also:

    VOLATILE

    public static final  int VOLATILE
    The int value representing the volatile modifier.
    See Also:

    field:TRANSIENT [CHANGED]

    TRANSIENT

    public static final  int TRANSIENT
    The int value representing the transient modifier.
    See Also:

    TRANSIENT

    public static final  int TRANSIENT
    The int value representing the transient modifier.
    See Also:

    TRANSIENT

    public static final  int TRANSIENT
    The int value representing the transient modifier.
    See Also:

    field:NATIVE [CHANGED]

    NATIVE

    public static final  int NATIVE
    The int value representing the native modifier.
    See Also:

    NATIVE

    public static final  int NATIVE
    The int value representing the native modifier.
    See Also:

    NATIVE

    public static final  int NATIVE
    The int value representing the native modifier.
    See Also:

    field:INTERFACE [CHANGED]

    INTERFACE

    public static final  int INTERFACE
    The int value representing the interface modifier.
    See Also:

    INTERFACE

    public static final  int INTERFACE
    The int value representing the interface modifier.
    See Also:

    INTERFACE

    public static final  int INTERFACE
    The int value representing the interface modifier.
    See Also:

    field:ABSTRACT [CHANGED]

    ABSTRACT

    public static final  int ABSTRACT
    The int value representing the abstract modifier.
    See Also:

    ABSTRACT

    public static final  int ABSTRACT
    The int value representing the abstract modifier.
    See Also:

    ABSTRACT

    public static final  int ABSTRACT
    The int value representing the abstract modifier.
    See Also:

    field:STRICT [CHANGED]

    STRICT

    public static final  int STRICT
    The int value representing the strictfp modifier.
    See Also:

    STRICT

    public static final  int STRICT
    The int value representing the strictfp modifier.
    See Also:

    STRICT

    public static final  int STRICT
    The int value representing the strictfp modifier.
    See Also:

    method:isPublic(int) [NONE]

  • isPublic

    public static  boolean isPublic (int mod)
    Return true if the integer argument includes the public modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the public modifier; false otherwise.
  • method:isPrivate(int) [NONE]

    isPrivate

    public static  boolean isPrivate (int mod)
    Return true if the integer argument includes the private modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the private modifier; false otherwise.

    method:isProtected(int) [NONE]

    isProtected

    public static  boolean isProtected (int mod)
    Return true if the integer argument includes the protected modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the protected modifier; false otherwise.

    method:isStatic(int) [NONE]

    isStatic

    public static  boolean isStatic (int mod)
    Return true if the integer argument includes the static modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the static modifier; false otherwise.

    method:isFinal(int) [NONE]

    isFinal

    public static  boolean isFinal (int mod)
    Return true if the integer argument includes the final modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the final modifier; false otherwise.

    method:isSynchronized(int) [NONE]

    isSynchronized

    public static  boolean isSynchronized (int mod)
    Return true if the integer argument includes the synchronized modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the synchronized modifier; false otherwise.

    method:isVolatile(int) [NONE]

    isVolatile

    public static  boolean isVolatile (int mod)
    Return true if the integer argument includes the volatile modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the volatile modifier; false otherwise.

    method:isTransient(int) [NONE]

    isTransient

    public static  boolean isTransient (int mod)
    Return true if the integer argument includes the transient modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the transient modifier; false otherwise.

    method:isNative(int) [NONE]

    isNative

    public static  boolean isNative (int mod)
    Return true if the integer argument includes the native modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the native modifier; false otherwise.

    method:isInterface(int) [NONE]

    isInterface

    public static  boolean isInterface (int mod)
    Return true if the integer argument includes the interface modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the interface modifier; false otherwise.

    method:isAbstract(int) [NONE]

    isAbstract

    public static  boolean isAbstract (int mod)
    Return true if the integer argument includes the abstract modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the abstract modifier; false otherwise.

    method:isStrict(int) [NONE]

    isStrict

    public static  boolean isStrict (int mod)
    Return true if the integer argument includes the strictfp modifier, false otherwise.
    Parameters:
    mod - a set of modifiers
    Returns:
    true if mod includes the strictfp modifier; false otherwise.

    method:toString(int) [NONE]

    toString

    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:
    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. Note that to perform such checking for a known kind of entity, such as a constructor or method, first AND the argument of toString with the appropriate mask from a method like constructorModifiers() or methodModifiers().
    Parameters:
    mod - a set of modifiers
    Returns:
    a string representation of the set of modifiers represented by mod

    method:classModifiers() [NONE]

    classModifiers

    public static  int classModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to a class.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to a class.
    See Java Language Specification :
    8.1.1 Class Modifiers
    Since:
    1.7

    method:interfaceModifiers() [NONE]

    interfaceModifiers

    public static  int interfaceModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to an interface.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to an interface.
    See Java Language Specification :
    9.1.1 Interface Modifiers
    Since:
    1.7

    method:constructorModifiers() [NONE]

    constructorModifiers

    public static  int constructorModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to a constructor.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to a constructor.
    See Java Language Specification :
    8.8.3 Constructor Modifiers
    Since:
    1.7

    method:methodModifiers() [NONE]

    methodModifiers

    public static  int methodModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to a method.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to a method.
    See Java Language Specification :
    8.4.3 Method Modifiers
    Since:
    1.7

    method:fieldModifiers() [NONE]

    fieldModifiers

    public static  int fieldModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to a field.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to a field.
    See Java Language Specification :
    8.3.1 Field Modifiers
    Since:
    1.7

    method:parameterModifiers() [NONE]

    parameterModifiers

    public static  int parameterModifiers()
    Return an int value OR-ing together the source language modifiers that can be applied to a parameter.
    Returns:
    an int value OR-ing together the source language modifiers that can be applied to a parameter.
    See Java Language Specification :
    8.4.1 Formal Parameters
    Since:
    1.8

    © 2023 Oracle Corporation and/or its affiliates