Skip to content

pascalgn/java-model

Repository files navigation

java-model

npm version

Provides high-level access to the Java type model, based on java-ast.

Usage

class A {
    private int i;
}

record B(String s) {
}

enum C { C1, C2 }
import { readFileSync } from "node:fs";
import { parse } from "java-model";

const project = parse({
    files: ["input.java"],
    read: (file) => readFileSync(file, "utf8")
});

project.visitTypes((type) => {
   console.log(type.name);
   console.log(type.qualifiedName);
   console.log(type.properties());
});

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published