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.class
resource 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 int
ALL
Combine all kinds of access.static int
ANNOTATION
Predefined set of access suitable for annotations.static 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.static int
DECLARED_CONSTRUCTORS
Declared constructors access: public, protected, default (package) access, and private ones.static int
DECLARED_FIELDS
Declared fields access: public, protected, default (package) access, and private, but excluding inherited ones.static int
DECLARED_METHODS
Declared methods access: public, protected, default (package) access, and private, but excluding inherited ones.static int
FULL_REFLECTION
Full reflection access.static int
JNI
Type must be accessible from JNI code (it will be placed in the jni-config.json and not reflect-config.json)static int
LOAD_AND_CONSTRUCT
Class and declared constructor access (default).static int
LOAD_AND_CONSTRUCT_AND_PUBLIC_METHODS
Class, declared constructor and public method access.static int
NONE
No access.static int
PUBLIC_CONSTRUCTORS
Public constructors.static int
PUBLIC_METHODS
Public methods access: public methods of the class including inherited ones.static int
RESOURCE
Resource access required when ASM is used at runtime to access to*.class
resources.
-
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 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.boolean
equals(Object that)
static AccessBits
forBits(int... bits)
static AccessBits
forValue(int value)
static Flag[]
getFlags(int value)
int
getValue()
boolean
hasAccess(AccessBits accessBitsToCheck)
int
hashCode()
boolean
isResourceAccessRequired()
static boolean
isResourceAccessRequired(Integer typeKind)
static boolean
isSet(int value, int mask)
String
toString()
static String
toString(Integer value)
AccessBits
with(AccessBits accessRequired)
-
-
-
Field Detail
-
RESOURCE
public static final int RESOURCE
Resource access required when ASM is used at runtime to access to*.class
resources.- 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_METHODS
when 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
-
JNI
public static final int JNI
Type must be accessible from JNI code (it will be placed in the jni-config.json and not reflect-config.json)- See Also:
- 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)
-
-