Modifier
open class Modifier
kotlin.Any | |
↳ | java.lang.reflect.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.
Summary
Constants | |
---|---|
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
static Int |
The |
Public constructors | |
---|---|
Modifier() |
Public methods | |
---|---|
open static Int |
Return an |
open static Int |
Return an |
open static Int |
Return an |
open static Int |
Return an |
open static Boolean |
isAbstract(mod: Int) Return |
open static Boolean |
Return |
open static Boolean |
isInterface(mod: Int) Return |
open static Boolean |
Return |
open static Boolean |
Return |
open static Boolean |
isProtected(mod: Int) Return |
open static Boolean |
Return |
open static Boolean |
Return |
open static Boolean |
Return |
open static Boolean |
isSynchronized(mod: Int) Return |
open static Boolean |
isTransient(mod: Int) Return |
open static Boolean |
isVolatile(mod: Int) Return |
open static Int |
Return an |
open static Int |
Return an |
open static String! |
Return a string describing the access modifier flags in the specified modifier. |
Constants
ABSTRACT
static val ABSTRACT: Int
The int
value representing the abstract
modifier.
Value: 1024
FINAL
static val FINAL: Int
The int
value representing the final
modifier.
Value: 16
INTERFACE
static val INTERFACE: Int
The int
value representing the interface
modifier.
Value: 512
NATIVE
static val NATIVE: Int
The int
value representing the native
modifier.
Value: 256
PRIVATE
static val PRIVATE: Int
The int
value representing the private
modifier.
Value: 2
PROTECTED
static val PROTECTED: Int
The int
value representing the protected
modifier.
Value: 4
PUBLIC
static val PUBLIC: Int
The int
value representing the public
modifier.
Value: 1
STATIC
static val STATIC: Int
The int
value representing the static
modifier.
Value: 8
STRICT
static val STRICT: Int
The int
value representing the strictfp
modifier.
Value: 2048
SYNCHRONIZED
static val SYNCHRONIZED: Int
The int
value representing the synchronized
modifier.
Value: 32
TRANSIENT
static val TRANSIENT: Int
The int
value representing the transient
modifier.
Value: 128
VOLATILE
static val VOLATILE: Int
The int
value representing the volatile
modifier.
Value: 64
Public constructors
Public methods
classModifiers
open static fun classModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to a class.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to a class. |
constructorModifiers
open static fun constructorModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to a constructor.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to a constructor. |
fieldModifiers
open static fun fieldModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to a field.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to a field. |
interfaceModifiers
open static fun interfaceModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to an interface.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to an interface. |
isAbstract
open static fun isAbstract(mod: Int): Boolean
Return true
if the integer argument includes the abstract
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the abstract modifier; false otherwise. |
isFinal
open static fun isFinal(mod: Int): Boolean
Return true
if the integer argument includes the final
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the final modifier; false otherwise. |
isInterface
open static fun isInterface(mod: Int): Boolean
Return true
if the integer argument includes the interface
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the interface modifier; false otherwise. |
isNative
open static fun isNative(mod: Int): Boolean
Return true
if the integer argument includes the native
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the native modifier; false otherwise. |
isPrivate
open static fun isPrivate(mod: Int): Boolean
Return true
if the integer argument includes the private
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the private modifier; false otherwise. |
isProtected
open static fun isProtected(mod: Int): Boolean
Return true
if the integer argument includes the protected
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the protected modifier; false otherwise. |
isPublic
open static fun isPublic(mod: Int): Boolean
Return true
if the integer argument includes the public
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the public modifier; false otherwise. |
isStatic
open static fun isStatic(mod: Int): Boolean
Return true
if the integer argument includes the static
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the static modifier; false otherwise. |
isStrict
open static fun isStrict(mod: Int): Boolean
Return true
if the integer argument includes the strictfp
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the strictfp modifier; false otherwise. |
isSynchronized
open static fun isSynchronized(mod: Int): Boolean
Return true
if the integer argument includes the synchronized
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the synchronized modifier; false otherwise. |
isTransient
open static fun isTransient(mod: Int): Boolean
Return true
if the integer argument includes the transient
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the transient modifier; false otherwise. |
isVolatile
open static fun isVolatile(mod: Int): Boolean
Return true
if the integer argument includes the volatile
modifier, false
otherwise.
Parameters | |
---|---|
mod |
Int: a set of modifiers |
Return | |
---|---|
Boolean |
true if mod includes the volatile modifier; false otherwise. |
methodModifiers
open static fun methodModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to a method.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to a method. |
parameterModifiers
open static fun parameterModifiers(): Int
Return an int
value OR-ing together the source language modifiers that can be applied to a parameter.
Return | |
---|---|
Int |
an int value OR-ing together the source language modifiers that can be applied to a parameter. |
toString
open static fun toString(mod: Int): String!
Return a string describing the access modifier flags in the specified modifier. For example:
public final synchronized strictfpThe 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 |
Int: a set of modifiers |
Return | |
---|---|
String! |
a string representation of the set of modifiers represented by mod |