GeezerVison is showing docs.oracle.com — Modifier (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.lang.reflect
Class Modifier
-
public class Modifier
extends 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.
- See Also:
Class.getModifiers(),
Member.getModifiers()
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static int |
ABSTRACT |
The int value representing the abstract
modifier.
|
static int |
FINAL |
The int value representing the final
modifier.
|
static int |
INTERFACE |
The int value representing the interface
modifier.
|
static int |
NATIVE |
The int value representing the native
modifier.
|
static int |
PRIVATE |
The int value representing the private
modifier.
|
static int |
PROTECTED |
The int value representing the protected
modifier.
|
static int |
PUBLIC |
The int value representing the public
modifier.
|
static int |
STATIC |
The int value representing the static
modifier.
|
static int |
STRICT |
The int value representing the strictfp
modifier.
|
static int |
SYNCHRONIZED |
The int value representing the synchronized
modifier.
|
static int |
TRANSIENT |
The int value representing the transient
modifier.
|
static int |
VOLATILE |
The int value representing the volatile
modifier.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
Modifier() |
|
-
Method Summary
All Methods Static Methods Concrete Methods
| Modifier and Type |
Method |
Description |
static int |
classModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to a class.
|
static int |
constructorModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to a constructor.
|
static int |
fieldModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to a field.
|
static int |
interfaceModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to an interface.
|
static boolean |
isAbstract(int mod) |
Return true if the integer argument includes the
abstract modifier, false otherwise.
|
static boolean |
isFinal(int mod) |
Return true if the integer argument includes the
final modifier, false otherwise.
|
static boolean |
isInterface(int mod) |
Return true if the integer argument includes the
interface modifier, false otherwise.
|
static boolean |
isNative(int mod) |
Return true if the integer argument includes the
native modifier, false otherwise.
|
static boolean |
isPrivate(int mod) |
Return true if the integer argument includes the
private modifier, false otherwise.
|
static boolean |
isProtected(int mod) |
Return true if the integer argument includes the
protected modifier, false otherwise.
|
static boolean |
isPublic(int mod) |
Return true if the integer argument includes the
public modifier, false otherwise.
|
static boolean |
isStatic(int mod) |
Return true if the integer argument includes the
static modifier, false otherwise.
|
static boolean |
isStrict(int mod) |
Return true if the integer argument includes the
strictfp modifier, false otherwise.
|
static boolean |
isSynchronized(int mod) |
Return true if the integer argument includes the
synchronized modifier, false otherwise.
|
static boolean |
isTransient(int mod) |
Return true if the integer argument includes the
transient modifier, false otherwise.
|
static boolean |
isVolatile(int mod) |
Return true if the integer argument includes the
volatile modifier, false otherwise.
|
static int |
methodModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to a method.
|
static int |
parameterModifiers() |
Return an int value OR-ing together the source language
modifiers that can be applied to a parameter.
|
static String |
toString(int mod) |
Return a string describing the access modifier flags in
the specified modifier.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Modifier
public Modifier()
-
Method Detail
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|