java.lang.Object
jdk.incubator.jextract.JextractTool
Simple extraction tool which generates a minimal Java API. Such an API consists mainly of static methods,
where for each native function a static method is added which calls the underlying native method handles.
Similarly, for struct fields and global variables, static accessors (getter and setter) are generated
on top of the underlying memory access var handles. For each struct, a static layout field is generated.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ToolProvider implementation for jextract tool. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<JavaFileObject>
static void
Main entry point to run the JextractToolstatic Declaration.Scoped
Parse input files into a toplevel declaration with given options.static void
write
(Path dest, boolean compileSources, List<JavaFileObject> files) Write resultingJavaFileObject
instances into specified destination path.
-
Field Details
-
DEBUG
public static final boolean DEBUG
-
-
Method Details
-
parse
Parse input files into a toplevel declaration with given options.- Parameters:
parserOptions
- options to be passed to the parser.- Returns:
- a toplevel declaration.
-
generate
public static List<JavaFileObject> generate(Declaration.Scoped decl, String headerName, String targetPkg, List<String> libNames) -
write
public static void write(Path dest, boolean compileSources, List<JavaFileObject> files) throws UncheckedIOException Write resultingJavaFileObject
instances into specified destination path.- Parameters:
dest
- the destination path.compileSources
- whether to compile .java sources or notfiles
- theJavaFileObject
instances to be written.- Throws:
UncheckedIOException
-
main
Main entry point to run the JextractTool- Parameters:
args
- command line options passed
-