Package gw.lang.reflect
Class Modifier
- java.lang.Object
-
- gw.lang.reflect.Modifier
-
public class Modifier extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intABSTRACTTheintvalue representing theabstractmodifier.static intANNOTATIONstatic intBRIDGEstatic intCLASS_MEMBERThe code indicating something is a class memberstatic intDEPRECATEDTheintvalue representing theenummodifier.static intENUMstatic intFINALTheintvalue representing thefinalmodifier.static intHIDETheintvalue representing thehidemodifier.static intINTERFACETheintvalue representing theinterfacemodifier.static intINTERNALTheintvalue representing theinternalmodifier.static intMANDATEDstatic intNATIVETheintvalue representing thenativemodifier.static intOVERRIDETheintvalue representing theoverridemodifier.static intPRIVATETheintvalue representing theprivatemodifier.static intPROTECTEDTheintvalue representing theprotectedmodifier.static intPUBLICTheintvalue representing thepublicmodifier.static intREIFIEDTheintvalue representing thereifiedmodifier.static intSTATICTheintvalue representing thestaticmodifier.static intSTRICTTheintvalue representing thestrictfpmodifier.static intSYNCHRONIZEDTheintvalue representing thesynchronizedmodifier.static intSYNTHETICstatic intTRANSIENTTheintvalue representing thetransientmodifier.static intVARARGSstatic intVOLATILETheintvalue representing thevolatilemodifier.
-
Constructor Summary
Constructors Constructor Description Modifier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intclassModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to a class.static intconstructorModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to a constructor.static intfieldModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to a field.static intgetModifiersFrom(IAttributedFeatureInfo afi)static intinterfaceModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to an interface.static booleanisAbstract(int mod)Returntrueif the integer argument includes theabstractmodifier,falseotherwise.static booleanisAnnotation(int mod)static booleanisClassMember(int mod)Return true if the integer argument includes the class member modifer, false otherwise.static booleanisDeprecated(int mod)static booleanisEnum(int mod)Return true if the integer argument includes the enum modifer, false otherwise.static booleanisFinal(int mod)Returntrueif the integer argument includes thefinalmodifier,falseotherwise.static booleanisHide(int mod)Return true if the integer argument includes the hide modifer, false otherwise.static booleanisInterface(int mod)Returntrueif the integer argument includes theinterfacemodifier,falseotherwise.static booleanisInternal(int mod)Return true if the integer argument includes the internal modifer, false otherwise.static booleanisMandated(int mod)static booleanisNative(int mod)Returntrueif the integer argument includes thenativemodifier,falseotherwise.static booleanisOverride(int mod)Return true if the integer argument includes the override modifer, false otherwise.static booleanisPrivate(int mod)Returntrueif the integer argument includes theprivatemodifier,falseotherwise.static booleanisProtected(int mod)Returntrueif the integer argument includes theprotectedmodifier,falseotherwise.static booleanisPublic(int mod)Returntrueif the integer argument includes thepublicmodifier,falseotherwise.static booleanisReified(int mod)static booleanisStatic(int mod)Returntrueif the integer argument includes thestaticmodifier,falseotherwise.static booleanisStrict(int mod)Returntrueif the integer argument includes thestrictfpmodifier,falseotherwise.static booleanisSynchronized(int mod)Returntrueif the integer argument includes thesynchronizedmodifier,falseotherwise.static booleanisSynthetic(int mod)static booleanisTransient(int mod)Returntrueif the integer argument includes thetransientmodifier,falseotherwise.static booleanisVolatile(int mod)Returntrueif the integer argument includes thevolatilemodifier,falseotherwise.static intmethodModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to a method.static intparameterModifiers()Return anintvalue OR-ing together the source language modifiers that can be applied to a parameter.static intsetAbstract(int mod, boolean bValue)static intsetClassMember(int mod, boolean bValue)static intsetDeprecated(int mod, boolean bValue)static intsetEnum(int mod, boolean bValue)static intsetFinal(int mod, boolean bValue)static intsetHide(int mod, boolean bValue)static intsetInternal(int mod, boolean bValue)static intsetOverride(int mod, boolean bValue)static intsetPrivate(int mod, boolean bValue)static intsetProtected(int mod, boolean bValue)static intsetPublic(int mod, boolean bValue)static intsetReified(int mod, boolean bValue)static intsetStatic(int mod, boolean bValue)static intsetTransient(int mod, boolean bValue)static StringtoModifierString(int mod)static StringtoString(int mod)Return a string describing the access modifier flags in the specified modifier.
-
-
-
Field Detail
-
PUBLIC
public static final int PUBLIC
Theintvalue representing thepublicmodifier.- See Also:
- Constant Field Values
-
PRIVATE
public static final int PRIVATE
Theintvalue representing theprivatemodifier.- See Also:
- Constant Field Values
-
PROTECTED
public static final int PROTECTED
Theintvalue representing theprotectedmodifier.- See Also:
- Constant Field Values
-
STATIC
public static final int STATIC
Theintvalue representing thestaticmodifier.- See Also:
- Constant Field Values
-
FINAL
public static final int FINAL
Theintvalue representing thefinalmodifier.- See Also:
- Constant Field Values
-
SYNCHRONIZED
public static final int SYNCHRONIZED
Theintvalue representing thesynchronizedmodifier.- See Also:
- Constant Field Values
-
VOLATILE
public static final int VOLATILE
Theintvalue representing thevolatilemodifier.- See Also:
- Constant Field Values
-
TRANSIENT
public static final int TRANSIENT
Theintvalue representing thetransientmodifier.- See Also:
- Constant Field Values
-
NATIVE
public static final int NATIVE
Theintvalue representing thenativemodifier.- See Also:
- Constant Field Values
-
INTERFACE
public static final int INTERFACE
Theintvalue representing theinterfacemodifier.- See Also:
- Constant Field Values
-
ABSTRACT
public static final int ABSTRACT
Theintvalue representing theabstractmodifier.- See Also:
- Constant Field Values
-
STRICT
public static final int STRICT
Theintvalue representing thestrictfpmodifier.- See Also:
- Constant Field Values
-
BRIDGE
public static final int BRIDGE
- See Also:
- Constant Field Values
-
VARARGS
public static final int VARARGS
- See Also:
- Constant Field Values
-
SYNTHETIC
public static final int SYNTHETIC
- See Also:
- Constant Field Values
-
ANNOTATION
public static final int ANNOTATION
- See Also:
- Constant Field Values
-
ENUM
public static final int ENUM
- See Also:
- Constant Field Values
-
MANDATED
public static final int MANDATED
- See Also:
- Constant Field Values
-
OVERRIDE
public static final int OVERRIDE
Theintvalue representing theoverridemodifier.- See Also:
- Constant Field Values
-
HIDE
public static final int HIDE
Theintvalue representing thehidemodifier.- See Also:
- Constant Field Values
-
CLASS_MEMBER
public static final int CLASS_MEMBER
The code indicating something is a class member- See Also:
- Constant Field Values
-
INTERNAL
public static final int INTERNAL
Theintvalue representing theinternalmodifier.- See Also:
- Constant Field Values
-
REIFIED
public static final int REIFIED
Theintvalue representing thereifiedmodifier.- See Also:
- Constant Field Values
-
DEPRECATED
public static final int DEPRECATED
Theintvalue representing theenummodifier. 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:
- Constant Field Values
-
-
Method Detail
-
isPublic
public static boolean isPublic(int mod)
Returntrueif the integer argument includes thepublicmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thepublicmodifier;falseotherwise.
-
isPrivate
public static boolean isPrivate(int mod)
Returntrueif the integer argument includes theprivatemodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theprivatemodifier;falseotherwise.
-
isProtected
public static boolean isProtected(int mod)
Returntrueif the integer argument includes theprotectedmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theprotectedmodifier;falseotherwise.
-
isStatic
public static boolean isStatic(int mod)
Returntrueif the integer argument includes thestaticmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thestaticmodifier;falseotherwise.
-
isFinal
public static boolean isFinal(int mod)
Returntrueif the integer argument includes thefinalmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thefinalmodifier;falseotherwise.
-
isSynchronized
public static boolean isSynchronized(int mod)
Returntrueif the integer argument includes thesynchronizedmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thesynchronizedmodifier;falseotherwise.
-
isVolatile
public static boolean isVolatile(int mod)
Returntrueif the integer argument includes thevolatilemodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thevolatilemodifier;falseotherwise.
-
isTransient
public static boolean isTransient(int mod)
Returntrueif the integer argument includes thetransientmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thetransientmodifier;falseotherwise.
-
isNative
public static boolean isNative(int mod)
Returntrueif the integer argument includes thenativemodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thenativemodifier;falseotherwise.
-
isInterface
public static boolean isInterface(int mod)
Returntrueif the integer argument includes theinterfacemodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theinterfacemodifier;falseotherwise.
-
isAbstract
public static boolean isAbstract(int mod)
Returntrueif the integer argument includes theabstractmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theabstractmodifier;falseotherwise.
-
isStrict
public static boolean isStrict(int mod)
Returntrueif the integer argument includes thestrictfpmodifier,falseotherwise.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes thestrictfpmodifier;falseotherwise.
-
toString
public static String toString(int mod)
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
Thepublic protected private abstract static final transient volatile synchronized native strictfp interfaceinterfacemodifier 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 oftoStringwith 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 anintvalue OR-ing together the source language modifiers that can be applied to a class.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to a class. - Since:
- 1.7
-
interfaceModifiers
public static int interfaceModifiers()
Return anintvalue OR-ing together the source language modifiers that can be applied to an interface.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to an interface. - Since:
- 1.7
-
constructorModifiers
public static int constructorModifiers()
Return anintvalue OR-ing together the source language modifiers that can be applied to a constructor.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to a constructor. - Since:
- 1.7
-
methodModifiers
public static int methodModifiers()
Return anintvalue OR-ing together the source language modifiers that can be applied to a method.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to a method. - Since:
- 1.7
-
fieldModifiers
public static int fieldModifiers()
Return anintvalue OR-ing together the source language modifiers that can be applied to a field.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to a field. - Since:
- 1.7
-
parameterModifiers
public static int parameterModifiers()
Return anintvalue OR-ing together the source language modifiers that can be applied to a parameter.- Returns:
- an
intvalue OR-ing together the source language modifiers that can be applied to a parameter. - Since:
- 1.8
-
getModifiersFrom
public static int getModifiersFrom(IAttributedFeatureInfo afi)
-
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
modincludes 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
modincludes 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
modincludes 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
modincludes 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
modincludes 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)
-
toModifierString
public static String toModifierString(int mod)
-
-