Crates.io | java-signatures |
lib.rs | java-signatures |
version | 0.1.0 |
source | src |
created_at | 2024-07-05 08:38:54.609185 |
updated_at | 2024-07-05 08:38:54.609185 |
description | java classfile signatures parser |
homepage | |
repository | https://github.com/xitep/java-signatures.git |
max_upload_size | |
id | 1292504 |
size | 57,891 |
A parser for Java's class / method / field signatures as described by the class file format allowing access to generic type information.
There is a number of rust crates to parse Java's classfiles and give access to the signatures, albeit, merely as raw strings. This small library attempts to fill the gap.
All of OpenJDK's 21 class, method, and field signatures parse correctly. This is, the parsed form serialized again to a signature yields the same string.
At this stage, the library does the right thing at providing structured access to the encoded signature data. While avoiding copies of the parsed string, no focused effort has been spent on performance yet, though.
Apart of the embedded unit tests, test/parse.rs
will pick up any
.class
file below test/parse/**
, extract their class / method /
field signature strings using
[cafebabe](https://github.com/staktrace/cafebabe)
, parse them using
java-signatures
and validate that the parsed signatures correctly
serialize back to their original form. To keep the repository small,
we do not host any class files there permanently.
java-signatures
the parsed model owns
the type information / names, hence, allocates, but may be easier to
work with as it retains no reference to the originally parsed
string.