Class Modifier

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.

toString

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:

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

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.

Since:

1.7

See The Java™ Language Specification:

8.1.1 Class Modifiers

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 inteface.

Since:

1.7

See The Java™ Language Specification:

9.1.1 Interface Modifiers

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.

Since:

1.7

See The Java™ Language Specification:

8.8.3 Constructor Modifiers

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.

Since:

1.7

See The Java™ Language Specification:

8.4.3 Method Modifiers

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.