Package gw.lang.reflect
Class Modifier
java.lang.Object
gw.lang.reflect.Modifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Theint
value representing theabstract
modifier.(package private) static final int
static final int
static final int
static final int
The code indicating something is a class memberprivate static final int
The Java source modifiers that can be applied to a class.private static final int
The Java source modifiers that can be applied to a constructor.static final int
Theint
value representing theenum
modifier.static final int
private static final int
The Java source modifiers that can be applied to a field.static final int
Theint
value representing thefinal
modifier.static final int
Theint
value representing thehide
modifier.static final int
Theint
value representing theinterface
modifier.private static final int
The Java source modifiers that can be applied to an interface.static final int
Theint
value representing theinternal
modifier.static final int
private static final int
The Java source modifiers that can be applied to a method.static final int
Theint
value representing thenative
modifier.static final int
Theint
value representing theoverride
modifier.private static final int
The Java source modifiers that can be applied to a method or constructor parameter.static final int
Theint
value representing theprivate
modifier.static final int
Theint
value representing theprotected
modifier.static final int
Theint
value representing thepublic
modifier.static final int
Theint
value representing thereified
modifier.static final int
Theint
value representing thestatic
modifier.static final int
Theint
value representing thestrictfp
modifier.static final int
Theint
value representing thesynchronized
modifier.static final int
static final int
Theint
value representing thetransient
modifier.static final int
static final int
Theint
value representing thevolatile
modifier. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Return anint
value OR-ing together the source language modifiers that can be applied to a class.static int
Return anint
value OR-ing together the source language modifiers that can be applied to a constructor.static int
Return anint
value OR-ing together the source language modifiers that can be applied to a field.static int
static int
Return anint
value OR-ing together the source language modifiers that can be applied to an interface.static boolean
isAbstract
(int mod) Returntrue
if the integer argument includes theabstract
modifier,false
otherwise.static boolean
isAnnotation
(int mod) static boolean
isClassMember
(int mod) Return true if the integer argument includes the class member modifer, false otherwise.static boolean
isDeprecated
(int mod) static boolean
isEnum
(int mod) Return true if the integer argument includes the enum modifer, false otherwise.static boolean
isFinal
(int mod) Returntrue
if the integer argument includes thefinal
modifier,false
otherwise.static boolean
isHide
(int mod) Return true if the integer argument includes the hide modifer, false otherwise.static boolean
isInterface
(int mod) Returntrue
if the integer argument includes theinterface
modifier,false
otherwise.static boolean
isInternal
(int mod) Return true if the integer argument includes the internal modifer, false otherwise.static boolean
isMandated
(int mod) static boolean
isNative
(int mod) Returntrue
if the integer argument includes thenative
modifier,false
otherwise.static boolean
isOverride
(int mod) Return true if the integer argument includes the override modifer, false otherwise.static boolean
isPrivate
(int mod) Returntrue
if the integer argument includes theprivate
modifier,false
otherwise.static boolean
isProtected
(int mod) Returntrue
if the integer argument includes theprotected
modifier,false
otherwise.static boolean
isPublic
(int mod) Returntrue
if the integer argument includes thepublic
modifier,false
otherwise.static boolean
isReified
(int mod) static boolean
isStatic
(int mod) Returntrue
if the integer argument includes thestatic
modifier,false
otherwise.static boolean
isStrict
(int mod) Returntrue
if the integer argument includes thestrictfp
modifier,false
otherwise.static boolean
isSynchronized
(int mod) Returntrue
if the integer argument includes thesynchronized
modifier,false
otherwise.static boolean
isSynthetic
(int mod) static boolean
isTransient
(int mod) Returntrue
if the integer argument includes thetransient
modifier,false
otherwise.static boolean
isVolatile
(int mod) Returntrue
if the integer argument includes thevolatile
modifier,false
otherwise.static int
Return anint
value OR-ing together the source language modifiers that can be applied to a method.static int
Return anint
value OR-ing together the source language modifiers that can be applied to a parameter.static int
setAbstract
(int mod, boolean bValue) private static int
setBit
(int mod, boolean bValue, int bit) static int
setClassMember
(int mod, boolean bValue) static int
setDeprecated
(int mod, boolean bValue) static int
setEnum
(int mod, boolean bValue) static int
setFinal
(int mod, boolean bValue) static int
setHide
(int mod, boolean bValue) static int
setInternal
(int mod, boolean bValue) static int
setOverride
(int mod, boolean bValue) static int
setPrivate
(int mod, boolean bValue) static int
setProtected
(int mod, boolean bValue) static int
setPublic
(int mod, boolean bValue) static int
setReified
(int mod, boolean bValue) static int
setStatic
(int mod, boolean bValue) static int
setTransient
(int mod, boolean bValue) static String
toModifierString
(int mod) static String
toString
(int mod) Return a string describing the access modifier flags in the specified modifier.
-
Field Details
-
PUBLIC
public static final int PUBLICTheint
value representing thepublic
modifier.- See Also:
-
PRIVATE
public static final int PRIVATETheint
value representing theprivate
modifier.- See Also:
-
PROTECTED
public static final int PROTECTEDTheint
value representing theprotected
modifier.- See Also:
-
STATIC
public static final int STATICTheint
value representing thestatic
modifier.- See Also:
-
FINAL
public static final int FINALTheint
value representing thefinal
modifier.- See Also:
-
SYNCHRONIZED
public static final int SYNCHRONIZEDTheint
value representing thesynchronized
modifier.- See Also:
-
VOLATILE
public static final int VOLATILETheint
value representing thevolatile
modifier.- See Also:
-
TRANSIENT
public static final int TRANSIENTTheint
value representing thetransient
modifier.- See Also:
-
NATIVE
public static final int NATIVETheint
value representing thenative
modifier.- See Also:
-
INTERFACE
public static final int INTERFACETheint
value representing theinterface
modifier.- See Also:
-
ABSTRACT
public static final int ABSTRACTTheint
value representing theabstract
modifier.- See Also:
-
STRICT
public static final int STRICTTheint
value representing thestrictfp
modifier.- See Also:
-
BRIDGE
public static final int BRIDGE- See Also:
-
VARARGS
public static final int VARARGS- See Also:
-
SYNTHETIC
public static final int SYNTHETIC- See Also:
-
ANNOTATION
public static final int ANNOTATION- See Also:
-
ENUM
public static final int ENUM- See Also:
-
MANDATED
public static final int MANDATED- See Also:
-
CLASS_MODIFIERS
private static final int CLASS_MODIFIERSThe Java source modifiers that can be applied to a class.- See Also:
-
INTERFACE_MODIFIERS
private static final int INTERFACE_MODIFIERSThe Java source modifiers that can be applied to an interface.- See Also:
-
CONSTRUCTOR_MODIFIERS
private static final int CONSTRUCTOR_MODIFIERSThe Java source modifiers that can be applied to a constructor.- See Also:
-
METHOD_MODIFIERS
private static final int METHOD_MODIFIERSThe Java source modifiers that can be applied to a method.- See Also:
-
FIELD_MODIFIERS
private static final int FIELD_MODIFIERSThe Java source modifiers that can be applied to a field.- See Also:
-
PARAMETER_MODIFIERS
private static final int PARAMETER_MODIFIERSThe Java source modifiers that can be applied to a method or constructor parameter.- See Also:
-
ACCESS_MODIFIERS
static final int ACCESS_MODIFIERS- See Also:
-
OVERRIDE
public static final int OVERRIDETheint
value representing theoverride
modifier.- See Also:
-
HIDE
public static final int HIDETheint
value representing thehide
modifier.- See Also:
-
CLASS_MEMBER
public static final int CLASS_MEMBERThe code indicating something is a class member- See Also:
-
INTERNAL
public static final int INTERNALTheint
value representing theinternal
modifier.- See Also:
-
REIFIED
public static final int REIFIEDTheint
value representing thereified
modifier.- See Also:
-
DEPRECATED
public static final int DEPRECATEDTheint
value representing theenum
modifier. This value should match the Java version of the enum modifier (which isn't publically exposed). Note that the enum modifier may mean different things in different contexts.- See Also:
-
-
Constructor Details
-
Modifier
public Modifier()
-
-
Method Details
-
isPublic
public static boolean isPublic(int mod) Returntrue
if the integer argument includes thepublic
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thepublic
modifier;false
otherwise.
-
isPrivate
public static boolean isPrivate(int mod) Returntrue
if the integer argument includes theprivate
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes theprivate
modifier;false
otherwise.
-
isProtected
public static boolean isProtected(int mod) Returntrue
if the integer argument includes theprotected
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes theprotected
modifier;false
otherwise.
-
isStatic
public static boolean isStatic(int mod) Returntrue
if the integer argument includes thestatic
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thestatic
modifier;false
otherwise.
-
isFinal
public static boolean isFinal(int mod) Returntrue
if the integer argument includes thefinal
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thefinal
modifier;false
otherwise.
-
isSynchronized
public static boolean isSynchronized(int mod) Returntrue
if the integer argument includes thesynchronized
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thesynchronized
modifier;false
otherwise.
-
isVolatile
public static boolean isVolatile(int mod) Returntrue
if the integer argument includes thevolatile
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thevolatile
modifier;false
otherwise.
-
isTransient
public static boolean isTransient(int mod) Returntrue
if the integer argument includes thetransient
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thetransient
modifier;false
otherwise.
-
isNative
public static boolean isNative(int mod) Returntrue
if the integer argument includes thenative
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thenative
modifier;false
otherwise.
-
isInterface
public static boolean isInterface(int mod) Returntrue
if the integer argument includes theinterface
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes theinterface
modifier;false
otherwise.
-
isAbstract
public static boolean isAbstract(int mod) Returntrue
if the integer argument includes theabstract
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes theabstract
modifier;false
otherwise.
-
isStrict
public static boolean isStrict(int mod) Returntrue
if the integer argument includes thestrictfp
modifier,false
otherwise.- Parameters:
mod
- a set of modifiers- Returns:
true
ifmod
includes thestrictfp
modifier;false
otherwise.
-
toString
Return a string describing the access modifier flags in the specified modifier. For example:
The 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 final synchronized strictfp
public protected private abstract static final transient volatile synchronized native strictfp interface
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 oftoString
with the appropriate mask from a method likeconstructorModifiers()
ormethodModifiers()
.- Parameters:
mod
- a set of modifiers- Returns:
- a string representation of the set of modifiers
represented by
mod
-
isSynthetic
public static boolean isSynthetic(int mod) -
isMandated
public static boolean isMandated(int mod) -
classModifiers
public static int classModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to a class.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to a class. - Since:
- 1.7
-
interfaceModifiers
public static int interfaceModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to an interface.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to an interface. - Since:
- 1.7
-
constructorModifiers
public static int constructorModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to a constructor.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to a constructor. - Since:
- 1.7
-
methodModifiers
public static int methodModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to a method.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to a method. - Since:
- 1.7
-
fieldModifiers
public static int fieldModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to a field.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to a field. - Since:
- 1.7
-
parameterModifiers
public static int parameterModifiers()Return anint
value OR-ing together the source language modifiers that can be applied to a parameter.- Returns:
- an
int
value OR-ing together the source language modifiers that can be applied to a parameter. - Since:
- 1.8
-
getModifiersFrom
-
isHide
public static boolean isHide(int mod) Return true if the integer argument includes the hide modifer, false otherwise.- Parameters:
mod
- a set of modifers- Returns:
- true if
mod
includes the hide modifier; false otherwise.
-
isOverride
public static boolean isOverride(int mod) Return true if the integer argument includes the override modifer, false otherwise.- Parameters:
mod
- a set of modifers- Returns:
- true if
mod
includes the override modifier; false otherwise.
-
isClassMember
public static boolean isClassMember(int mod) Return true if the integer argument includes the class member modifer, false otherwise.- Parameters:
mod
- a set of modifers- Returns:
- true if
mod
includes the class member modifier; false otherwise.
-
isInternal
public static boolean isInternal(int mod) Return true if the integer argument includes the internal modifer, false otherwise.- Parameters:
mod
- a set of modifers- Returns:
- true if
mod
includes the internal modifier; false otherwise.
-
isEnum
public static boolean isEnum(int mod) Return true if the integer argument includes the enum modifer, false otherwise.- Parameters:
mod
- a set of modifers- Returns:
- true if
mod
includes the enum modifier; false otherwise.
-
isDeprecated
public static boolean isDeprecated(int mod) -
isAnnotation
public static boolean isAnnotation(int mod) -
isReified
public static boolean isReified(int mod) -
setPublic
public static int setPublic(int mod, boolean bValue) -
setPrivate
public static int setPrivate(int mod, boolean bValue) -
setProtected
public static int setProtected(int mod, boolean bValue) -
setStatic
public static int setStatic(int mod, boolean bValue) -
setAbstract
public static int setAbstract(int mod, boolean bValue) -
setFinal
public static int setFinal(int mod, boolean bValue) -
setOverride
public static int setOverride(int mod, boolean bValue) -
setHide
public static int setHide(int mod, boolean bValue) -
setClassMember
public static int setClassMember(int mod, boolean bValue) -
setTransient
public static int setTransient(int mod, boolean bValue) -
setInternal
public static int setInternal(int mod, boolean bValue) -
setEnum
public static int setEnum(int mod, boolean bValue) -
setDeprecated
public static int setDeprecated(int mod, boolean bValue) -
setReified
public static int setReified(int mod, boolean bValue) -
setBit
private static int setBit(int mod, boolean bValue, int bit) -
toModifierString
-