Class 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 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 when Class.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
      • 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
      • FULL_REFLECTION

        public static final int FULL_REFLECTION
        Full reflection 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
    • Constructor Detail

      • AccessBits

        public AccessBits()
      • AccessBits

        public AccessBits​(int value)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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)
      • 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 level
        newAccess - the new access level
        Returns:
        what the new proposed access is adding
      • isSet

        public static boolean isSet​(int value,
                                    int mask)