public final class Mod extends Object
Notice: This class should be named IClass.IModifier, but changing the name would break existing client
code. Thus it won't be renamed until there's a really good reason to do it (maybe with a major design change).
| Modifier and Type | Field | Description |
|---|---|---|
static short |
ABSTRACT |
This flag is set on all interfaces, ABSTRACT classes and ABSTRACT methods, and is mutually exclusive with
FINAL, NATIVE, PRIVATE, STATIC and SYNCHRONIZED. |
static short |
ANNOTATION |
This flag is set on annotation types (including nested annotation types), and requires that
INTERFACE
is also set. |
static short |
BRIDGE |
This flag is set on 'bridge methods' generated by the compiler.
|
static short |
ENUM |
This flag is set on enumerated types (including nested enumerated types) and enumerated types' elements, and is
mutually exclusive with
INTERFACE. |
static short |
FINAL |
|
static short |
INTERFACE |
This flag is set on interfaces (including nested interfaces), and requires that
ABSTRACT must also be
set. |
static short |
NATIVE |
This flag is set on NATIVE methods, and is mutually exclusive with
ABSTRACT. |
static short |
NONE |
An alias for '0' -- no modifiers.
|
static short |
PACKAGE |
The flag indicating 'default accessibility' a.k.a.
|
static short |
PPP |
The mask to select the accessibility flags from modifiers.
|
static short |
PRIVATE |
The flag indicating 'private accessibility' of the modified element.
|
static short |
PROTECTED |
The flag indicating 'protected accessibility' of the modified element.
|
static short |
PUBLIC |
The flag indicating 'public accessibility' of the modified element.
|
static short |
STATIC |
This flag is set on class or interface initialization methods, STATIC class fields, all interface fields, STATIC
methods, and STATIC nested classes.
|
static short |
STRICTFP |
This flag is set on STRICTFP methods, and is mutually exclusive with
ABSTRACT. |
static short |
SUPER |
This flag is always set on classes, and never set on any other element.
|
static short |
SYNCHRONIZED |
This flag is set on SYNCHRONIZED methods.
|
static short |
SYNTHETIC |
This flag is set on classes, methods and fields that were generated by the compiler and do not appear in the
source code.
|
static short |
TRANSIENT |
This flag is set on TRANSIENT fields.
|
static short |
VARARGS |
This flag is set on 'variable arity' (a.k.a.
|
static short |
VOLATILE |
This flag is set on VOLATILE fields and is mutually exclusive with
FINAL. |
| Modifier and Type | Method | Description |
|---|---|---|
static short |
changeAccess(short modifiers,
short newAccess) |
|
static boolean |
isAbstract(short sh) |
|
static boolean |
isAnnotation(short sh) |
|
static boolean |
isBridge(short sh) |
|
static boolean |
isEnum(short sh) |
|
static boolean |
isFinal(short sh) |
|
static boolean |
isInterface(short sh) |
|
static boolean |
isNative(short sh) |
|
static boolean |
isPackageAccess(short sh) |
|
static boolean |
isPrivateAccess(short sh) |
|
static boolean |
isProtectedAccess(short sh) |
|
static boolean |
isPublicAccess(short sh) |
|
static boolean |
isStatic(short sh) |
|
static boolean |
isStrictfp(short sh) |
|
static boolean |
isSuper(short sh) |
|
static boolean |
isSynchronized(short sh) |
|
static boolean |
isSynthetic(short sh) |
|
static boolean |
isTransient(short sh) |
|
static boolean |
isVarargs(short sh) |
|
static boolean |
isVolatile(short sh) |
|
static String |
shortToString(short sh) |
Composes and returns a string that maps the given modifier as follows:
Value zero is mapped to "".
|
public static final short NONE
public static final short PUBLIC
PUBLIC.PPP,
isPublicAccess(short),
Constant Field Valuespublic static final short PRIVATE
PPP,
isPrivateAccess(short),
Constant Field Valuespublic static final short PROTECTED
PPP,
isProtectedAccess(short),
Constant Field Valuespublic static final short PACKAGE
PPP,
isPackageAccess(short),
Constant Field Valuespublic static final short PPP
public static final short STATIC
public static final short FINAL
VOLATILE and ABSTRACT.public static final short SUPER
SYNCHRONIZED, which is OK because SYNCHRONIZED is for methods and SUPER for classes.public static final short SYNCHRONIZED
SUPER, which is OK
because SYNCHRONIZED is for methods and SUPER for classes.public static final short VOLATILE
FINAL. Notice that it has the same
value as BRIDGE, which is OK because BRIDGE is for methods and VOLATILE for fields.public static final short BRIDGE
VOLATILE, which is OK because BRIDGE is for methods and VOLATILE for fields.public static final short TRANSIENT
VARARGS, which is OK because
VARARGS is for methods and TRANSIENT for fields.public static final short VARARGS
TRANSIENT, which is OK because VARARGS is for methods and TRANSIENT for
fields.public static final short NATIVE
ABSTRACT.public static final short INTERFACE
ABSTRACT must also be
set. INTERFACE is mutually exclusive with FINAL, SUPER and ENUM.public static final short ABSTRACT
FINAL, NATIVE, PRIVATE, STATIC and SYNCHRONIZED.public static final short STRICTFP
ABSTRACT.public static final short SYNTHETIC
public static final short ANNOTATION
INTERFACE
is also set.public static final short ENUM
INTERFACE.public static boolean isPublicAccess(short sh)
PUBLIC accessibilitypublic static boolean isPrivateAccess(short sh)
PRIVATE accessibilitypublic static boolean isProtectedAccess(short sh)
PROTECTED accessibilitypublic static boolean isPackageAccess(short sh)
PACKAGE (a.k.a. 'default') accessibilitypublic static short changeAccess(short modifiers,
short newAccess)
modifiers, but with the accessibility part changed to newAccesspublic static boolean isStatic(short sh)
STATICpublic static boolean isFinal(short sh)
INTERFACEpublic static boolean isSuper(short sh)
SUPERpublic static boolean isSynchronized(short sh)
SYNCHRONIZEDpublic static boolean isVolatile(short sh)
VOLATILEpublic static boolean isBridge(short sh)
BRIDGEpublic static boolean isTransient(short sh)
TRANSIENTpublic static boolean isVarargs(short sh)
VARARGSpublic static boolean isNative(short sh)
NATIVEpublic static boolean isInterface(short sh)
INTERFACEpublic static boolean isAbstract(short sh)
ABSTRACTpublic static boolean isStrictfp(short sh)
STRICTFPpublic static boolean isSynthetic(short sh)
SYNTHETICpublic static boolean isAnnotation(short sh)
ANNOTATIONpublic static boolean isEnum(short sh)
ENUMpublic static String shortToString(short sh)
VARARGS is mapped to "transient", because the two flags have the same value
SUPER is mapped to "synchronized", because the two flags have the same value
BRIDGE is mapped to "volatile", because the two flags have the same value
Copyright © 2001–2019. All rights reserved.