Expand description

Provides mechanisms to parse and then inspect java class files. Java classes have very specific formats that can be parsed. However, because the format relies on constantly referring back to a constant pool, information can be hard to actually parse. This library provides easier mechanisms for digesting this info.

There are three main entrance points to the api: parse_file, parse_bytes, and JavaClassParser

Example

If you want to inspect many classes, it may be better to create the parser using a classpath, then finding classes by their fully qualified path.

let mut parser = JavaClassParser::new("classes.jar");
let class1 = parser.find("com.example.TestClass").expect("couldn't find class");
let class2 = parser.find("com.example.OtherTestClass").expect("couldn't find class");

Modules

Parsed attributes
Contains the error type that can be emitted
Provides mechanisms to inspect the inheritance structure of a class

Structs

An owned version of a fully qualified name
A field in a class
A java class
Parses java classes from .class files. Produces a JavaClass if successful.
A field in a class

Enums

A signature

Traits

Objects which implement this trait can be queried for their attributes.

Functions

Parse bytes into a java class.
Parses the contents of a file into a java class