A language-agnostic Java framework for representing, enriching, and compiling code models.
codemodel provides a structured, serializable representation of software systems — independent of
any particular programming language, paradigm, or source format. A code model can be populated from
any source (compiled JVM classes, source files, a TypeScript AST, a visual language, or anything
else), then enriched, validated, and compiled through a plugin pipeline. The JDK-backed modules are
the reference implementation, not the limit of the framework.
| Module | Purpose |
|---|---|
codemodel-foundation |
Core TypeDescriptor / TypeUsage / Trait system, naming, marshalling |
expression-codemodel |
Expression AST nodes and extensible operator-precedence parser |
hierarchical-codemodel |
Type hierarchy: ancestors, descendants, assignability |
imperative-codemodel |
Statement AST nodes: Block, If, While, Return |
objectoriented-codemodel |
OOP traits: fields, methods, constructors, access modifiers |
jdk-codemodel |
JDK-backed implementation via reflection or javac |
dependency-injection |
Custom JSR-330 DI built on jdk-codemodel |
codemodel-framework |
Pipeline interfaces: Enricher, TypeChecker, Compiler, Completer |
codemodel-framework-builder |
Concrete FrameworkBuilder and InternalFramework |
jdk-annotation-discovery |
AnnotationDiscovery SPI and @Discoverable |
jdk-annotation-processor |
javax.annotation.processing.Processor driving the full pipeline |
- Java 25+
- Maven (wrapper included — no separate install needed)
Add individual modules as dependencies. All modules share the same version:
<dependency>
<groupId>build.codemodel</groupId>
<artifactId>codemodel-foundation</artifactId>
<version>VERSION</version>
</dependency>Replace VERSION with the latest version shown in the Maven Central badge above.
./mvnw clean installTo build a custom version:
./mvnw -Drevision=x.y.z-SNAPSHOT-my-name clean installCode style is enforced by Checkstyle: no tabs, no star imports, final locals and parameters, braces
required on all blocks, no assert statements. Import order: third-party, standard Java, then
static. IntelliJ configuration is at config/intellij/CodeStyle.xml.
Commit messages follow Conventional Commits.
Apache 2.0 — see LICENSE