Enum TypeAccess

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TypeAccess>

    public enum TypeAccess
    extends java.lang.Enum<TypeAccess>
    The various types of access that can be requested. The values of these match the names that go into the json configuration for native-image.
    Author:
    Andy Clement, Sebastien Deleuze
    See Also:
    Manual configuration of reflection use in native images
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AUTO_DETECT
      Inferred with: PUBLIC_METHODS for annotations and interfaces None for arrays (class access) DECLARED_CONSTRUCTORS for other types
      DECLARED_CLASSES
      Do not automatically register the inner classes for reflective access but make them available via Class.getDeclaredClasses().
      DECLARED_CONSTRUCTORS
      Declared constructors access: public, protected, default (package) access, and private ones.
      DECLARED_FIELDS
      Declared fields access: public, protected, default (package) access, and private, but excluding inherited ones.
      DECLARED_METHODS
      Declared methods access: public, protected, default (package) access, and private, but excluding inherited ones.
      JNI
      Configure related JNI reflection entry, to be combined with other `Flag` entries.
      PUBLIC_CLASSES
      Do not automatically register the inner classes for reflective access but make them available via Class.getClasses().
      PUBLIC_CONSTRUCTORS
      Public constructors.
      PUBLIC_FIELDS
      Public fields access.
      PUBLIC_METHODS
      Public methods access: public methods of the class including inherited ones.
      QUERY_DECLARED_CONSTRUCTORS
      Declared constructor's metadata query: public, protected, default (package) access, and private ones.
      QUERY_DECLARED_METHODS
      Declared method's metadata query: public, protected, default (package) access, and private, but excluding inherited ones.
      QUERY_PUBLIC_CONSTRUCTORS
      Queried public constructors.
      QUERY_PUBLIC_METHODS
      Public method's metadata query access: public methods of the class including inherited ones.
      RESOURCE
      Configure access to the *.class file resource.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toString​(TypeAccess[] access)  
      java.lang.String value()  
      static TypeAccess valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TypeAccess[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • JNI

        public static final TypeAccess JNI
        Configure related JNI reflection entry, to be combined with other `Flag` entries.
      • RESOURCE

        public static final TypeAccess RESOURCE
        Configure access to the *.class file resource.
      • PUBLIC_FIELDS

        public static final TypeAccess PUBLIC_FIELDS
        Public fields access.
        See Also:
        Class.getFields()
      • DECLARED_FIELDS

        public static final TypeAccess DECLARED_FIELDS
        Declared fields access: public, protected, default (package) access, and private, but excluding inherited ones.
        See Also:
        Class.getDeclaredFields()
      • DECLARED_CONSTRUCTORS

        public static final TypeAccess DECLARED_CONSTRUCTORS
        Declared constructors access: public, protected, default (package) access, and private ones.
        See Also:
        Class.getDeclaredConstructors()
      • PUBLIC_CONSTRUCTORS

        public static final TypeAccess PUBLIC_CONSTRUCTORS
        Public constructors.
        See Also:
        Class.getConstructors()
      • DECLARED_METHODS

        public static final TypeAccess DECLARED_METHODS
        Declared methods access: public, protected, default (package) access, and private, but excluding inherited ones. Consider whether you need this or @link PUBLIC_METHODS.
        See Also:
        Class.getDeclaredMethods()
      • PUBLIC_METHODS

        public static final TypeAccess PUBLIC_METHODS
        Public methods access: public methods of the class including inherited ones. Consider whether you need this or @link DECLARED_METHODS.
        See Also:
        Class.getMethods()
      • DECLARED_CLASSES

        public static final TypeAccess DECLARED_CLASSES
        Do not automatically register the inner classes for reflective access but make them available via Class.getDeclaredClasses().
      • PUBLIC_CLASSES

        public static final TypeAccess PUBLIC_CLASSES
        Do not automatically register the inner classes for reflective access but make them available via Class.getClasses().
      • QUERY_DECLARED_METHODS

        public static final TypeAccess QUERY_DECLARED_METHODS
        Declared method's metadata query: public, protected, default (package) access, and private, but excluding inherited ones. Consider whether you need this or @link QUERY_PUBLIC_METHODS.
        See Also:
        Class.getDeclaredMethods()
      • QUERY_PUBLIC_METHODS

        public static final TypeAccess QUERY_PUBLIC_METHODS
        Public method's metadata query access: public methods of the class including inherited ones. Consider whether you need this or @link QUERY_DECLARED_METHODS.
        See Also:
        Class.getMethods()
      • QUERY_DECLARED_CONSTRUCTORS

        public static final TypeAccess QUERY_DECLARED_CONSTRUCTORS
        Declared constructor's metadata query: public, protected, default (package) access, and private ones.
        See Also:
        Class.getDeclaredConstructors()
      • QUERY_PUBLIC_CONSTRUCTORS

        public static final TypeAccess QUERY_PUBLIC_CONSTRUCTORS
        Queried public constructors.
        See Also:
        Class.getConstructors()
    • Method Detail

      • values

        public static TypeAccess[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TypeAccess c : TypeAccess.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TypeAccess valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • value

        public java.lang.String value()
      • toString

        public static java.lang.String toString​(TypeAccess[] access)