Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.62 KB

File metadata and controls

60 lines (42 loc) · 1.62 KB

Code Transformation Format - Java Bindings

This library provides domain objects for interacting with Code Transformation Format (CodeTF) files.

Features

These objects offer the following attributes:

  • Decorated with Jackson annotations
  • Sanity checking CodeTF requirements
  • Immutability
  • JavaDocs to help you understand what data is expected
  • Support for multiple CodeTF versions (v2 and v3)

Adding to your project

To deserialize a CodeTF file using these objects, simply deserialize with Jackson's typical APIs:

Gradle

implementation("io.codemodder:codetf-java:4.6.0")

Maven

<dependency>
  <groupId>io.codemodder</groupId>
  <artifactId>codetf-java</artifactId>
  <version>4.6.0</version>
</dependency>

Using in your project

This library provides properly annotated data classes for both CodeTF v2 and v3 formats. You should choose which format to use based on your requirements and explicitly deserialize to that format.

Working with original CodeTF format (v2)

ObjectMapper mapper = new ObjectMapper();
CodeTFReport report = mapper.readValue(codetfFile, CodeTFReport.class);

Working with the new CodeTF v3 format

ObjectMapper mapper = new ObjectMapper();
io.codemodder.codetf.v3.CodeTF v3Report = mapper.readValue(codetfFile, io.codemodder.codetf.v3.CodeTF.class);

This approach allows applications to use their own centralized ObjectMapper with custom configurations.

Running Formatter

To run the autoformatter, run the following command:

mvn fmt:format