3

在哪里可以找到使用选项 - 、和设置的GraalVMnative-image配置文件的文档/架构?-H:ConfigurationFileDirectories=<dir>jni-config.jsonreflect-config.jsonproxy-config.jsonresource-config.json

4

1 回答 1

2

我认为架构可以在这里找到。此外,您可以在更高级别的目录之一中找到所有必要的解析器。

我在这里复制模式以防它过时:

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" }
        ]
      }
    ]
于 2019-11-17T13:02:43.063 回答