Creates wrapper klasses in Kotlin for CXF java classes generated from WSDL specifications.
- Data classes for all DTO's
- Even for inheritance
- Enforces nullability in spec, with Kotlin nullability
- Eliminates JAXBElement bonanza
It uses Tree-Sitter to parse Java-classes generated by Apache CXF wsdl2java, then converts it, and creates Kotlin-classes.
It does some enhancements in the conversion:
- Reads
required=true
annotations on fields, and sets the nullability of the fields in the Kotlin version accordingly - Eliminates XMLElement bonanza
- Converts inheritance to interfaces and data classes, so that every DTO have the data class abilities (automatic .equals, .copy-methods etc.)
This in written in Rust, and can be cross-compiled to binaries that can be included in a gradle/maven plugin. This can be set up to be run after Apache CXF wsdl2java.
./wsdl2kotlin /path/to/folder/with/generated/java/classes
A more automatic setup would be to use the cxf-codegen-plugin, and have a similar gradle/maven plugin for this repo run after that.
TODO: add gradle/maven plugin
Build language parser
# clone https://github.com/tree-sitter/tree-sitter-java to the root of this repo
cd tree-sitter-java
npm install
npm run build-test
Build
cargo build
Run tests
cargo test
This setup requires some installs, but does not require running in a docker-container, and is as a result dramatically faster.
- rustup
brew uninstall rust # conflicts with rustup
brew install rustup-init
rustup-init
- Install linux target
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-apple-darwin
- Install MUSL based GCC
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl