Package org.springframework.nativex.hint
Class AccessBits
- java.lang.Object
-
- org.springframework.nativex.hint.AccessBits
-
public class AccessBits extends Object
Specifies the reflective access desired for a type and whether it needs to be accessible as a resource in the image (i.e. the.classresource to be readable as a byte array).- Author:
- Andy Clement, Sebastien Deleuze
- See Also:
- Manual configuration of reflection use in native images
-
-
Field Summary
Fields Modifier and Type Field Description static intALLCombine all kinds of access.static intANNOTATIONPredefined set of access suitable for annotations.static intCLASSClass access, for example whenClass.forName(String)is invoked with a non constant parameter that can't be recognized automatically by the native image compiler.static intDECLARED_CONSTRUCTORSDeclared constructors access: public, protected, default (package) access, and private ones.static intDECLARED_FIELDSDeclared fields access: public, protected, default (package) access, and private, but excluding inherited ones.static intDECLARED_METHODSDeclared methods access: public, protected, default (package) access, and private, but excluding inherited ones.static intFULL_REFLECTIONFull reflection access.static intLOAD_AND_CONSTRUCTClass and declared constructor access (default).static intLOAD_AND_CONSTRUCT_AND_PUBLIC_METHODSClass, declared constructor and public method access.static intNONENo access.static intPUBLIC_CONSTRUCTORSPublic constructors.static intPUBLIC_METHODSPublic methods access: public methods of the class including inherited ones.static intRESOURCEResource access required when ASM is used at runtime to access to*.classresources.
-
Constructor Summary
Constructors Constructor Description AccessBits()AccessBits(int value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcompareAccess(int currentAccess, int newAccess)Compare a current access level with a proposed access level and return what the new proposed access is adding.booleanequals(Object that)static AccessBitsforBits(int... bits)static AccessBitsforValue(int value)static Flag[]getFlags(int value)intgetValue()booleanhasAccess(AccessBits accessBitsToCheck)inthashCode()booleanisResourceAccessRequired()static booleanisResourceAccessRequired(Integer typeKind)static booleanisSet(int value, int mask)StringtoString()static StringtoString(Integer value)AccessBitswith(AccessBits accessRequired)
-
-
-
Field Detail
-
RESOURCE
public static final int RESOURCE
Resource access required when ASM is used at runtime to access to*.classresources.- See Also:
- Constant Field Values
-
CLASS
public static final int CLASS
Class access, for example whenClass.forName(String)is invoked with a non constant parameter that can't be recognized automatically by the native image compiler.- See Also:
- Constant Field Values
-
DECLARED_CONSTRUCTORS
public static final int DECLARED_CONSTRUCTORS
Declared constructors access: public, protected, default (package) access, and private ones.
-
DECLARED_METHODS
public static final int DECLARED_METHODS
Declared methods access: public, protected, default (package) access, and private, but excluding inherited ones. Use the more restrictivePUBLIC_METHODSwhen possible.- See Also:
Class.getDeclaredMethods(), Constant Field Values
-
DECLARED_FIELDS
public static final int DECLARED_FIELDS
Declared fields access: public, protected, default (package) access, and private, but excluding inherited ones.- See Also:
Class.getDeclaredFields(), Constant Field Values
-
PUBLIC_METHODS
public static final int PUBLIC_METHODS
Public methods access: public methods of the class including inherited ones. Consider whether you need this or @linkDECLARED_METHODS.- See Also:
Class.getMethods(), Constant Field Values
-
PUBLIC_CONSTRUCTORS
public static final int PUBLIC_CONSTRUCTORS
Public constructors.- See Also:
Class.getConstructors(), Constant Field Values
-
NONE
public static final int NONE
No access.- See Also:
- Constant Field Values
-
FULL_REFLECTION
public static final int FULL_REFLECTION
Full reflection access.- See Also:
- Constant Field Values
-
ALL
public static final int ALL
Combine all kinds of access.- See Also:
- Constant Field Values
-
ANNOTATION
public static final int ANNOTATION
Predefined set of access suitable for annotations.- See Also:
- Constant Field Values
-
LOAD_AND_CONSTRUCT
public static final int LOAD_AND_CONSTRUCT
Class and declared constructor access (default).- See Also:
- Constant Field Values
-
LOAD_AND_CONSTRUCT_AND_PUBLIC_METHODS
public static final int LOAD_AND_CONSTRUCT_AND_PUBLIC_METHODS
Class, declared constructor and public method access.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFlags
public static Flag[] getFlags(int value)
-
forValue
public static final AccessBits forValue(int value)
-
forBits
public static final AccessBits forBits(int... bits)
-
isResourceAccessRequired
public boolean isResourceAccessRequired()
-
hasAccess
public boolean hasAccess(AccessBits accessBitsToCheck)
-
with
public AccessBits with(AccessBits accessRequired)
-
isResourceAccessRequired
public static boolean isResourceAccessRequired(Integer typeKind)
-
getValue
public int getValue()
-
compareAccess
public static int compareAccess(int currentAccess, int newAccess)Compare a current access level with a proposed access level and return what the new proposed access is adding.- Parameters:
currentAccess- the current access levelnewAccess- the new access level- Returns:
- what the new proposed access is adding
-
isSet
public static boolean isSet(int value, int mask)
-
-