Top Description Fields Constructors Methods
org.codehaus.janino

public final Class Mod

extends Object
Class Inheritance

This class defines constants and convenience methods for the handling of modifiers as defined by the JVM.

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).

Field Summary

Modifier and TypeField and Description
public static final 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.

public static final short
ANNOTATION

This flag is set on annotation types (including nested annotation types), and requires that INTERFACE is also set.

public static final short
BRIDGE

This flag is set on 'bridge methods' generated by the compiler.

public static final short
ENUM

This flag is set on enumerated types (including nested enumerated types) and enumerated types' elements, and is mutually exclusive with INTERFACE.

public static final short
FINAL

This flag is set on FINAL classes, FINAL fields and FINAL methods, and is mutually exclusive with VOLATILE and ABSTRACT.

public static final short
INTERFACE

This flag is set on interfaces (including nested interfaces), and requires that ABSTRACT must also be set.

public static final short
NATIVE

This flag is set on NATIVE methods, and is mutually exclusive with ABSTRACT.

public static final short
NONE

An alias for '0' -- no modifiers.

public static final short
PACKAGE

The flag indicating 'default accessibility' a.k.a. 'package accessibility' of the modified element.

public static final short
PPP

The mask to select the accessibility flags from modifiers.

public static final short
PRIVATE

The flag indicating 'private accessibility' of the modified element.

public static final short
PROTECTED

The flag indicating 'protected accessibility' of the modified element.

public static final short
PUBLIC

The flag indicating 'public accessibility' of the modified element.

public static final short
STATIC

This flag is set on class or interface initialization methods, STATIC class fields, all interface fields, STATIC methods, and STATIC nested classes.

public static final short
STRICTFP

This flag is set on STRICTFP methods, and is mutually exclusive with ABSTRACT.

public static final short
SUPER

This flag is always set on classes, and never set on any other element.

public static final short
SYNCHRONIZED

This flag is set on SYNCHRONIZED methods.

public static final 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.

public static final short
TRANSIENT

This flag is set on TRANSIENT fields.

public static final short
VARARGS

This flag is set on 'variable arity' (a.k.a. 'varargs') methods and constructors.

public static final short
VOLATILE

This flag is set on VOLATILE fields and is mutually exclusive with FINAL.

Constructor Summary

AccessConstructor and Description
private
Mod()

Method Summary

Modifier and TypeMethod and Description
public static short

Returns:

The given modifiers, but with the accessibility part changed to newAccess
changeAccess
(short modifiers, short newAccess)

public static boolean

Returns:

Whether the given modifier includes ABSTRACT
isAbstract
(short sh)

public static boolean

Returns:

Whether the given modifier includes ANNOTATION
isAnnotation
(short sh)

public static boolean

Returns:

Whether the given modifier includes BRIDGE
isBridge
(short sh)

public static boolean

Returns:

Whether the given modifier includes ENUM
isEnum
(short sh)

public static boolean

Returns:

Whether the given modifier includes INTERFACE
isFinal
(short sh)

public static boolean

Returns:

Whether the given modifier includes INTERFACE
isInterface
(short sh)

public static boolean

Returns:

Whether the given modifier includes NATIVE
isNative
(short sh)

public static boolean

Returns:

Whether the given modifier symbolizes PACKAGE (a.k.a. 'default') accessibility
isPackageAccess
(short sh)

public static boolean

Returns:

Whether the given modifier symbolizes PRIVATE accessibility
isPrivateAccess
(short sh)

public static boolean

Returns:

Whether the given modifier symbolizes PROTECTED accessibility
isProtectedAccess
(short sh)

public static boolean

Returns:

Whether the given modifier symbolizes PUBLIC accessibility
isPublicAccess
(short sh)

public static boolean

Returns:

Whether the given modifier includes STATIC
isStatic
(short sh)

public static boolean

Returns:

Whether the given modifier includes STRICTFP
isStrictfp
(short sh)

public static boolean

Returns:

Whether the given modifier includes SUPER
isSuper
(short sh)

public static boolean

Returns:

Whether the given modifier includes SYNCHRONIZED
isSynchronized
(short sh)

public static boolean

Returns:

Whether the given modifier includes SYNTHETIC
isSynthetic
(short sh)

public static boolean

Returns:

Whether the given modifier includes TRANSIENT
isTransient
(short sh)

public static boolean

Returns:

Whether the given modifier includes VARARGS
isVarargs
(short sh)

public static boolean

Returns:

Whether the given modifier includes VOLATILE
isVolatile
(short sh)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ABSTRACTback to summary
public static final 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.

ANNOTATIONback to summary
public static final short ANNOTATION

This flag is set on annotation types (including nested annotation types), and requires that INTERFACE is also set.

BRIDGEback to summary
public static final short BRIDGE

This flag is set on 'bridge methods' generated by the compiler. Notice that it has the same value as VOLATILE, which is OK because BRIDGE is for methods and VOLATILE for fields.

ENUMback to summary
public static final short ENUM

This flag is set on enumerated types (including nested enumerated types) and enumerated types' elements, and is mutually exclusive with INTERFACE.

FINALback to summary
public static final short FINAL

This flag is set on FINAL classes, FINAL fields and FINAL methods, and is mutually exclusive with VOLATILE and ABSTRACT.

INTERFACEback to summary
public static final short INTERFACE

This flag is set on interfaces (including nested interfaces), and requires that ABSTRACT must also be set. INTERFACE is mutually exclusive with FINAL, SUPER and ENUM.

NATIVEback to summary
public static final short NATIVE

This flag is set on NATIVE methods, and is mutually exclusive with ABSTRACT.

NONEback to summary
public static final short NONE

An alias for '0' -- no modifiers.

PACKAGEback to summary
public static final short PACKAGE

The flag indicating 'default accessibility' a.k.a. 'package accessibility' of the modified element.

See Also
PPP, isPackageAccess(short)
PPPback to summary
public static final short PPP

The mask to select the accessibility flags from modifiers.

PRIVATEback to summary
public static final short PRIVATE

The flag indicating 'private accessibility' of the modified element.

See Also
PPP, isPrivateAccess(short)
PROTECTEDback to summary
public static final short PROTECTED

The flag indicating 'protected accessibility' of the modified element.

See Also
PPP, isProtectedAccess(short)
PUBLICback to summary
public static final short PUBLIC

The flag indicating 'public accessibility' of the modified element. Methods of interfaces are always PUBLIC.

See Also
PPP, isPublicAccess(short)
STATICback to summary
public static final short STATIC

This flag is set on class or interface initialization methods, STATIC class fields, all interface fields, STATIC methods, and STATIC nested classes.

STRICTFPback to summary
public static final short STRICTFP

This flag is set on STRICTFP methods, and is mutually exclusive with ABSTRACT.

SUPERback to summary
public static final short SUPER

This flag is always set on classes, and never set on any other element. Notice that it has the same value as SYNCHRONIZED, which is OK because SYNCHRONIZED is for methods and SUPER for classes.

SYNCHRONIZEDback to summary
public static final short SYNCHRONIZED

This flag is set on SYNCHRONIZED methods. Notice that it has the same value as SUPER, which is OK because SYNCHRONIZED is for methods and SUPER for classes.

SYNTHETICback to summary
public static final 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.

TRANSIENTback to summary
public static final short TRANSIENT

This flag is set on TRANSIENT fields. Notice that it has the same value as VARARGS, which is OK because VARARGS is for methods and TRANSIENT for fields.

VARARGSback to summary
public static final short VARARGS

This flag is set on 'variable arity' (a.k.a. 'varargs') methods and constructors. Notice that it has the same value as TRANSIENT, which is OK because VARARGS is for methods and TRANSIENT for fields.

VOLATILEback to summary
public static final short VOLATILE

This flag is set on VOLATILE fields and is mutually exclusive with FINAL. Notice that it has the same value as BRIDGE, which is OK because BRIDGE is for methods and VOLATILE for fields.

Constructor Detail

Modback to summary
private Mod()

Method Detail

changeAccessback to summary
public static short changeAccess(short modifiers, short newAccess)
Returns:short

The given modifiers, but with the accessibility part changed to newAccess

isAbstractback to summary
public static boolean isAbstract(short sh)
Returns:boolean

Whether the given modifier includes ABSTRACT

isAnnotationback to summary
public static boolean isAnnotation(short sh)
Returns:boolean

Whether the given modifier includes ANNOTATION

isBridgeback to summary
public static boolean isBridge(short sh)
Returns:boolean

Whether the given modifier includes BRIDGE

isEnumback to summary
public static boolean isEnum(short sh)
Returns:boolean

Whether the given modifier includes ENUM

isFinalback to summary
public static boolean isFinal(short sh)
Returns:boolean

Whether the given modifier includes INTERFACE

isInterfaceback to summary
public static boolean isInterface(short sh)
Returns:boolean

Whether the given modifier includes INTERFACE

isNativeback to summary
public static boolean isNative(short sh)
Returns:boolean

Whether the given modifier includes NATIVE

isPackageAccessback to summary
public static boolean isPackageAccess(short sh)
Returns:boolean

Whether the given modifier symbolizes PACKAGE (a.k.a. 'default') accessibility

isPrivateAccessback to summary
public static boolean isPrivateAccess(short sh)
Returns:boolean

Whether the given modifier symbolizes PRIVATE accessibility

isProtectedAccessback to summary
public static boolean isProtectedAccess(short sh)
Returns:boolean

Whether the given modifier symbolizes PROTECTED accessibility

isPublicAccessback to summary
public static boolean isPublicAccess(short sh)
Returns:boolean

Whether the given modifier symbolizes PUBLIC accessibility

isStaticback to summary
public static boolean isStatic(short sh)
Returns:boolean

Whether the given modifier includes STATIC

isStrictfpback to summary
public static boolean isStrictfp(short sh)
Returns:boolean

Whether the given modifier includes STRICTFP

isSuperback to summary
public static boolean isSuper(short sh)
Returns:boolean

Whether the given modifier includes SUPER

isSynchronizedback to summary
public static boolean isSynchronized(short sh)
Returns:boolean

Whether the given modifier includes SYNCHRONIZED

isSyntheticback to summary
public static boolean isSynthetic(short sh)
Returns:boolean

Whether the given modifier includes SYNTHETIC

isTransientback to summary
public static boolean isTransient(short sh)
Returns:boolean

Whether the given modifier includes TRANSIENT

isVarargsback to summary
public static boolean isVarargs(short sh)
Returns:boolean

Whether the given modifier includes VARARGS

isVolatileback to summary
public static boolean isVolatile(short sh)
Returns:boolean

Whether the given modifier includes VOLATILE