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
Nested ClassesModifier and TypeClassDescriptionstatic classToolProvider implementation for jextract tool. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic List<JavaFileObject>static voidMain entry point to run the JextractToolstatic Declaration.ScopedParse input files into a toplevel declaration with given options.static voidwrite(Path dest, boolean compileSources, List<JavaFileObject> files) Write resultingJavaFileObjectinstances 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 resultingJavaFileObjectinstances into specified destination path.- Parameters:
dest- the destination path.compileSources- whether to compile .java sources or notfiles- theJavaFileObjectinstances to be written.- Throws:
UncheckedIOException
-
main
Main entry point to run the JextractTool- Parameters:
args- command line options passed
-