简体   繁体   中英

Documentation of GraalVM native-image -H:ConfigurationFileDirectories files

Where can be found a documentation / schema of GraalVM native-image configuration files that are set using -H:ConfigurationFileDirectories=<dir> option - jni-config.json , reflect-config.json , proxy-config.json and resource-config.json ?

I think the schema can be found here . Also, you can find all necessary parsers in one of the higher-level directories.

I'm copying the schema here in case it gets outdated:

One or several (comma-separated) paths to JSON files that specify which program elements should be made available via reflection.
The JSON object schema is:

    {
      String name; // fully qualified class name
      boolean allDeclaredConstructors; // include all declared constructors, see Class.getDeclaredConstructors()
      boolean allPublicConstructors;   // include all public constructors, see Class.getConstructors()
      boolean allDeclaredMethods; // include all declared methods, see Class.getDeclaredMethods()
      boolean allPublicMethods;   // include all public methods, see Class.getMethods()
      boolean allDeclaredFields;  // include all declared fields, see Class.getDeclaredFields()
      boolean allPublicFields;    // include all public fields, see Class.getFields()
      {
        String name; // method name
        String[] parameterTypes; // parameter types (optional, use if ambiguous)
      }[] methods;
      {
        String name; // field name
      }[] fields;
    }[];

Example:

    [
      {
        "name" : "java.lang.Class",
        "allDeclaredConstructors" : "true",
        "allPublicConstructors" : "true",
        "allDeclaredMethods" : "true",
        "allPublicMethods" : "true"
      },
      {
        "name" : "java.lang.String",
        "fields" : [
          { "name" : "value" },
          { "name" : "hash" }
        ],
        "methods" : [
          { "name" : "<init>", "parameterTypes" : [] },
          { "name" : "<init>", "parameterTypes" : ["char[]"] },
          { "name" : "charAt" },
          { "name" : "format", "parameterTypes" : ["java.lang.String", "java.lang.Object[]"] },
        ]
      },
      {
        "name" : "java.lang.String$CaseInsensitiveComparator",
        "methods" : [
          { "name" : "compare" }
        ]
      }
    ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM