|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.Modifier
public final class Modifier
The Modifier class provides 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 JavaTM Virtual Machine Specification, Second edition tables 4.1, 4.4, 4.5, and 4.7.
The modifiers in the Squawk system augment those defined in the JVM specification to include flags denoting Squawk specific properties of classes and members.
Field Summary | |
---|---|
static int |
ABSTRACT
The int value representing the abstract
modifier. |
static int |
ARRAY
The int value denoting that a class represents a Java array. |
static int |
COMPLETE_RUNTIME_STATICS
The int value denoting that a class has at least one static variable
that requires initialization from a ConstantValue attribute and/or must have
a runtime representation because it is accessed via a getstatic or putstatic instruction. |
static int |
CONSTANT
The int value denoting that a field has a ConstantValue. |
static int |
CONSTRUCTOR
The int value denoting that a method is a constructor. |
static int |
DOUBLEWORD
The int value denoting that a class represents a double
word type (i.e. |
static int |
FINAL
The int value representing the final
modifier. |
static int |
GLOBAL_STATICS
The int value denoting that the static fields in a class are VM global . |
static int |
HAS_PRAGMAS
The int value denoting that a method has one or more pragmas applied to it. |
static int |
INTERFACE
The int value representing the interface
modifier. |
static int |
MUSTCLINIT
The int value denoting that a class must have its
class initializer executed before it is used. |
static int |
NATIVE
The int value representing the native
modifier. |
static int |
PRIMITIVE
The int value denoting that a class represents a primitive
type. |
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 |
SOURCE_SYNTHETIC
The int value denoting that a class, method or field does not appear in the source code. |
static int |
SQUAWKARRAY
The int value denoting that a class whose instances are
represented in the array object format. |
static int |
SQUAWKPRIMITIVE
The int value denoting that a class represents a special class
that the Squawk translator and compiler convert into a primitive type. |
static int |
STATIC
The int value representing the static
modifier. |
static int |
STRICT
The int value representing the strictfp
modifier. |
static int |
SUITE_PRIVATE
The int value denoting that a class is not exported outside of its suite. |
static int |
SUPER
The int value denoting that superclass methods should
be treated specially when invoked by the invokespecial instruction. |
static int |
SYNCHRONIZED
The int value representing the synchronized
modifier. |
static int |
SYNTHETIC
The int value denoting that a class that does not have
a class file representation. |
static int |
TRANSIENT
The int value representing the transient
modifier. |
static int |
VOLATILE
The int value representing the volatile
modifier. |
Method Summary | |
---|---|
static int |
getJVMClassModifiers()
Gets the mask of modifiers that are defined the JVM specification that pertain to a class. |
static int |
getJVMFieldModifiers()
Gets the mask of modifiers that are defined the JVM specification that pertain to a field. |
static int |
getJVMMethodModifiers()
Gets the mask of modifiers that are defined the JVM specification that pertain to a method. |
static boolean |
hasConstant(int mod)
Return true if the integer argument includes the CONSTANT modifer, false otherwise. |
static boolean |
hasGlobalStatics(int mod)
|
static boolean |
hasPragmas(int mod)
Return true if the integer argument includes the HAS_PRAGMAS modifer, false otherwise. |
static boolean |
isAbstract(int mod)
Return true if the integer argument includes the abstract modifer, false otherwise. |
static boolean |
isArray(int mod)
Return true if the integer argument includes the ARRAY modifer, false otherwise. |
static boolean |
isConstructor(int mod)
Return true if the integer argument includes the CONSTRUCTOR modifer, false otherwise. |
static boolean |
isDoubleWord(int mod)
Return true if the integer argument includes the DOUBLEWORD modifer, false otherwise. |
static boolean |
isFinal(int mod)
Return true if the integer argument includes the final modifer, false otherwise. |
static boolean |
isInterface(int mod)
Return true if the integer argument includes the interface modifer, false otherwise. |
static boolean |
isNative(int mod)
Return true if the integer argument includes the native modifer, false otherwise. |
static boolean |
isPackagePrivate(int mod)
Return true if the integer argument does not include the public, protected or private modifer, false otherwise. |
static boolean |
isPrimitive(int mod)
Return true if the integer argument includes the PRIMITIVE modifer, false otherwise. |
static boolean |
isPrivate(int mod)
Return true if the integer argument includes the private modifer, false otherwise. |
static boolean |
isProtected(int mod)
Return true if the integer argument includes the protected modifer, false otherwise. |
static boolean |
isPublic(int mod)
Return true if the integer argument includes the public modifer, false otherwise. |
static boolean |
isSourceSynthetic(int mod)
Return true if the integer argument includes the SOURCE_SYNTHETIC modifer, false otherwise. |
static boolean |
isSquawkArray(int mod)
Return true if the integer argument includes the SQUAWKARRAY modifer, false otherwise. |
static boolean |
isSquawkPrimitive(int mod)
Return true if the integer argument includes the SQUAWKPRIMITIVE modifer, false otherwise. |
static boolean |
isStatic(int mod)
Return true if the integer argument includes the static modifer, false otherwise. |
static boolean |
isStrict(int mod)
Return true if the integer argument includes the strictfp modifer, false otherwise. |
static boolean |
isSuitePrivate(int mod)
Return true if the class is not exported from the suite. |
static boolean |
isSynchronized(int mod)
Return true if the integer argument includes the synchronized modifer, false otherwise. |
static boolean |
isSynthetic(int mod)
Return true if the integer argument includes the SYNTHETIC modifer, false otherwise. |
static boolean |
isTransient(int mod)
Return true if the integer argument includes the transient modifer, false otherwise. |
static boolean |
isVolatile(int mod)
Return true if the integer argument includes the volatile modifer, false otherwise. |
static boolean |
mustClinit(int mod)
Return true if the integer argument includes the MUSTCLINIT modifer, false otherwise. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PUBLIC
int
value representing the public
modifier. For CLASSES, FIELDS, METHODS.
public static final int PRIVATE
int
value representing the private
modifier. For inner CLASSES, FIELDS, METHODS.
public static final int PROTECTED
int
value representing the protected
modifier. For inner CLASSES, FIELDS, METHODS.
public static final int STATIC
int
value representing the static
modifier. For inner CLASSES, FIELDS, METHODS.
public static final int FINAL
int
value representing the final
modifier. For CLASSES, FIELDS, METHODS.
public static final int SYNCHRONIZED
int
value representing the synchronized
modifier. For METHODS.
public static final int SUPER
int
value denoting that superclass methods should
be treated specially when invoked by the invokespecial instruction.
For CLASSES.
public static final int VOLATILE
int
value representing the volatile
modifier. For FIELDS.
public static final int TRANSIENT
int
value representing the transient
modifier. For FIELDS.
public static final int NATIVE
int
value representing the native
modifier. For METHODS.
public static final int INTERFACE
int
value representing the interface
modifier. For CLASSES.
public static final int ABSTRACT
int
value representing the abstract
modifier. For CLASSES, METHODS.
public static final int STRICT
int
value representing the strictfp
modifier. For METHODS (and CLASSES?)
public static final int SOURCE_SYNTHETIC
int
value denoting that a class, method or field does not appear in the source code.
public static final int SYNTHETIC
int
value denoting that a class that does not have
a class file representation.
public static final int CONSTRUCTOR
int
value denoting that a method is a constructor.
public static final int HAS_PRAGMAS
int
value denoting that a method has one or more pragmas
applied to it.
public static final int CONSTANT
int
value denoting that a field has a ConstantValue.
public static final int MUSTCLINIT
int
value denoting that a class must have its
class initializer executed before it is used.
public static final int PRIMITIVE
int
value denoting that a class represents a primitive
type.
public static final int DOUBLEWORD
int
value denoting that a class represents a double
word type (i.e. long
or double
).
public static final int ARRAY
int
value denoting that a class represents a Java array.
public static final int SQUAWKARRAY
int
value denoting that a class whose instances are
represented in the array object format.
public static final int SQUAWKPRIMITIVE
int
value denoting that a class represents a special class
that the Squawk translator and compiler convert into a primitive type. Values
of these types are not compatible with any other types and requires explicit
conversions.
For efficiency and to avoid meta-circularity, the Squawk primitive variables are intercepted by the translator and converted into the base type (int or long) so no real object is created at run-time.
There are a number of restrictions that must be observed when programming with these classes. Some of these constraints are imposed to keep the job of the translator simple. All of these constraints are currently enforced by the translator. The constraints are:
null
) than T.
public static final int COMPLETE_RUNTIME_STATICS
int
value denoting that a class has at least one static variable
that requires initialization from a ConstantValue attribute and/or must have
a runtime representation because it is accessed via a getstatic or putstatic instruction.
This occurs (at least) in the following TCK tests:
javasoft.sqe.tests.vm.classfmt.atr.atrcvl004.atrcvl00401m1.atrcvl00401m1_wrapper
javasoft.sqe.tests.vm.classfmt.cpl.cplint001.cplint00101m1.cplint00101m1_wrapper
javasoft.sqe.tests.vm.classfmt.cpl.cpllng001.cpllng00101m1.cpllng00101m1_wrapper
javasoft.sqe.tests.vm.overview.SpecInitMethods.SpecInitMethods004.SpecInitMethods00405m1.SpecInitMethods004_wrapper
public static final int GLOBAL_STATICS
int
value denoting that the static fields in a class are VM global
.
public static final int SUITE_PRIVATE
int
value denoting that a class is not exported outside of its suite.
Method Detail |
---|
public static boolean isPublic(int mod)
mod
- a set of modifers
mod
includes the
public modifier; false otherwise.public static boolean isPrivate(int mod)
mod
- a set of modifers
mod
includes the
private modifier; false otherwise.public static boolean isProtected(int mod)
mod
- a set of modifers
mod
includes the
protected modifier; false otherwise.public static boolean isPackagePrivate(int mod)
mod
- a set of modifers
mod
does not include the
public, protected or private modifier; false otherwise.public static boolean isStatic(int mod)
mod
- a set of modifers
mod
includes the
static modifier; false otherwise.public static boolean isFinal(int mod)
mod
- a set of modifers
mod
includes the
final modifier; false otherwise.public static boolean isSynchronized(int mod)
mod
- a set of modifers
mod
includes the
synchronized modifier; false otherwise.public static boolean isVolatile(int mod)
mod
- a set of modifers
mod
includes the
volatile modifier; false otherwise.public static boolean isTransient(int mod)
mod
- a set of modifers
mod
includes the
transient modifier; false otherwise.public static boolean isNative(int mod)
mod
- a set of modifers
mod
includes the
native modifier; false otherwise.public static boolean isInterface(int mod)
mod
- a set of modifers
mod
includes the
interface modifier; false otherwise.public static boolean isAbstract(int mod)
mod
- a set of modifers
mod
includes the
abstract modifier; false otherwise.public static boolean isStrict(int mod)
mod
- a set of modifers
mod
includes the
strictfp modifier; false otherwise.public static int getJVMClassModifiers()
public static int getJVMMethodModifiers()
public static int getJVMFieldModifiers()
public static boolean mustClinit(int mod)
mod
- a set of modifers
mod
includes the
MUSTCLINIT modifier; false otherwise.public static boolean isPrimitive(int mod)
mod
- a set of modifers
mod
includes the
PRIMITIVE modifier; false otherwise.public static boolean isSynthetic(int mod)
mod
- a set of modifers
mod
includes the
SYNTHETIC modifier; false otherwise.public static boolean isSourceSynthetic(int mod)
mod
- a set of modifers
mod
includes the
SOURCE_SYNTHETIC modifier; false otherwise.public static boolean isDoubleWord(int mod)
mod
- a set of modifers
mod
includes the
DOUBLEWORD modifier; false otherwise.public static boolean isArray(int mod) throws AllowInlinedPragma
mod
- a set of modifers
mod
includes the
ARRAY modifier; false otherwise.
AllowInlinedPragma
public static boolean isSquawkArray(int mod) throws AllowInlinedPragma
mod
- a set of modifers
mod
includes the
SQUAWKARRAY modifier; false otherwise.
AllowInlinedPragma
public static boolean isSquawkPrimitive(int mod) throws AllowInlinedPragma
mod
- a set of modifers
mod
includes the
SQUAWKPRIMITIVE modifier; false otherwise.
AllowInlinedPragma
public static boolean isConstructor(int mod)
mod
- a set of modifers
mod
includes the
CONSTRUCTOR modifier; false otherwise.public static boolean hasConstant(int mod)
mod
- a set of modifers
mod
includes the
CONSTANT modifier; false otherwise.public static boolean hasPragmas(int mod)
mod
- a set of modifers
mod
includes the
HAS_PRAGMAS modifier; false otherwise.public static boolean hasGlobalStatics(int mod)
public static boolean isSuitePrivate(int mod)
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |