Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Modifier

public class Modifier
extends Object

java.lang.Object
   ↳ java.lang.reflect.Modifier


This class provides static methods to decode class and member modifiers.

See also:

Summary

Constants

int ABSTRACT

The int value representing the abstract modifier.

int FINAL

The int value representing the final modifier.

int INTERFACE

The int value representing the interface modifier.

int NATIVE

The int value representing the native modifier.

int PRIVATE

The int value representing the private modifier.

int PROTECTED

The int value representing the protected modifier.

int PUBLIC

The int value representing the public modifier.

int STATIC

The int value representing the static modifier.

int STRICT

The int value representing the strictfp modifier.

int SYNCHRONIZED

The int value representing the synchronized modifier.

int TRANSIENT

The int value representing the transient modifier.

int VOLATILE

The int value representing the volatile modifier.

Public constructors

Modifier()

Constructs a new Modifier instance.

Public methods

static int classModifiers()

Returns a mask of all the modifiers that may be applied to classes.

static int constructorModifiers()

Returns a mask of all the modifiers that may be applied to constructors.

static int fieldModifiers()

Returns a mask of all the modifiers that may be applied to fields.

static int interfaceModifiers()

Returns a mask of all the modifiers that may be applied to interfaces.

static boolean isAbstract(int modifiers)

Returns true if the given modifiers contain ABSTRACT.

static boolean isFinal(int modifiers)

Returns true if the given modifiers contain FINAL.

static boolean isInterface(int modifiers)

Returns true if the given modifiers contain INTERFACE.

static boolean isNative(int modifiers)

Returns true if the given modifiers contain NATIVE.

static boolean isPrivate(int modifiers)

Returns true if the given modifiers contain PRIVATE.

static boolean isProtected(int modifiers)

Returns true if the given modifiers contain PROTECTED.

static boolean isPublic(int modifiers)

Returns true if the given modifiers contain PUBLIC.

static boolean isStatic(int modifiers)

Returns true if the given modifiers contain STATIC.

static boolean isStrict(int modifiers)

Returns true if the given modifiers contain STRICT.

static boolean isSynchronized(int modifiers)

Returns true if the given modifiers contain SYNCHRONIZED.

static boolean isTransient(int modifiers)

Returns true if the given modifiers contain TRANSIENT.

static boolean isVolatile(int modifiers)

Returns true if the given modifiers contain VOLATILE.

static int methodModifiers()

Returns a mask of all the modifiers that may be applied to methods.

static String toString(int modifiers)

Returns a string containing the string representation of all modifiers present in the specified modifiers.

Inherited methods

From class java.lang.Object

Constants

ABSTRACT

Added in API level 1
int ABSTRACT

The int value representing the abstract modifier.

Constant Value: 1024 (0x00000400)

FINAL

Added in API level 1
int FINAL

The int value representing the final modifier.

Constant Value: 16 (0x00000010)

INTERFACE

Added in API level 1
int INTERFACE

The int value representing the interface modifier.

Constant Value: 512 (0x00000200)

NATIVE

Added in API level 1
int NATIVE

The int value representing the native modifier.

Constant Value: 256 (0x00000100)

PRIVATE

Added in API level 1
int PRIVATE

The int value representing the private modifier.

Constant Value: 2 (0x00000002)

PROTECTED

Added in API level 1
int PROTECTED

The int value representing the protected modifier.

Constant Value: 4 (0x00000004)

PUBLIC

Added in API level 1
int PUBLIC

The int value representing the public modifier.

Constant Value: 1 (0x00000001)

STATIC

Added in API level 1
int STATIC

The int value representing the static modifier.

Constant Value: 8 (0x00000008)

STRICT

Added in API level 1
int STRICT

The int value representing the strictfp modifier.

Constant Value: 2048 (0x00000800)

SYNCHRONIZED

Added in API level 1
int SYNCHRONIZED

The int value representing the synchronized modifier.

Constant Value: 32 (0x00000020)

TRANSIENT

Added in API level 1
int TRANSIENT

The int value representing the transient modifier.

Constant Value: 128 (0x00000080)

VOLATILE

Added in API level 1
int VOLATILE

The int value representing the volatile modifier.

Constant Value: 64 (0x00000040)

Public constructors

Modifier

Added in API level 1
Modifier ()

Constructs a new Modifier instance.

Public methods

classModifiers

Added in API level 19
int classModifiers ()

Returns a mask of all the modifiers that may be applied to classes.

Returns
int

constructorModifiers

Added in API level 19
int constructorModifiers ()

Returns a mask of all the modifiers that may be applied to constructors.

Returns
int

fieldModifiers

Added in API level 19
int fieldModifiers ()

Returns a mask of all the modifiers that may be applied to fields.

Returns
int

interfaceModifiers

Added in API level 19
int interfaceModifiers ()

Returns a mask of all the modifiers that may be applied to interfaces.

Returns
int

isAbstract

Added in API level 1
boolean isAbstract (int modifiers)

Returns true if the given modifiers contain ABSTRACT.

Parameters
modifiers int
Returns
boolean

isFinal

Added in API level 1
boolean isFinal (int modifiers)

Returns true if the given modifiers contain FINAL.

Parameters
modifiers int
Returns
boolean

isInterface

Added in API level 1
boolean isInterface (int modifiers)

Returns true if the given modifiers contain INTERFACE.

Parameters
modifiers int
Returns
boolean

isNative

Added in API level 1
boolean isNative (int modifiers)

Returns true if the given modifiers contain NATIVE.

Parameters
modifiers int
Returns
boolean

isPrivate

Added in API level 1
boolean isPrivate (int modifiers)

Returns true if the given modifiers contain PRIVATE.

Parameters
modifiers int
Returns
boolean

isProtected

Added in API level 1
boolean isProtected (int modifiers)

Returns true if the given modifiers contain PROTECTED.

Parameters
modifiers int
Returns
boolean

isPublic

Added in API level 1
boolean isPublic (int modifiers)

Returns true if the given modifiers contain PUBLIC.

Parameters
modifiers int
Returns
boolean

isStatic

Added in API level 1
boolean isStatic (int modifiers)

Returns true if the given modifiers contain STATIC.

Parameters
modifiers int
Returns
boolean

isStrict

Added in API level 1
boolean isStrict (int modifiers)

Returns true if the given modifiers contain STRICT.

Parameters
modifiers int
Returns
boolean

isSynchronized

Added in API level 1
boolean isSynchronized (int modifiers)

Returns true if the given modifiers contain SYNCHRONIZED.

Parameters
modifiers int
Returns
boolean

isTransient

Added in API level 1
boolean isTransient (int modifiers)

Returns true if the given modifiers contain TRANSIENT.

Parameters
modifiers int
Returns
boolean

isVolatile

Added in API level 1
boolean isVolatile (int modifiers)

Returns true if the given modifiers contain VOLATILE.

Parameters
modifiers int
Returns
boolean

methodModifiers

Added in API level 19
int methodModifiers ()

Returns a mask of all the modifiers that may be applied to methods.

Returns
int

toString

Added in API level 1
String toString (int modifiers)

Returns a string containing the string representation of all modifiers present in the specified modifiers. Modifiers appear in the order specified by the Java Language Specification.

Parameters
modifiers int
Returns
String
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.