Getting Started
This guide should help you to set up AutoJSON. For the overall documentation, check the JavaDocs (or, well, Dokka).
Setting up the dependency
First, you have to add my maven repository and the dependency:
repositories { // other repositories maven("https://theo.is-a.dev/maven-repo/")}
dependencies { // other dependencies implementation("dev.drtheo:autojson:[INSERT VERSION HERE]")}repositories { // other repositories maven { url "https://theo.is-a.dev/maven-repo/" }}
dependencies { // other dependencies implementation "dev.drtheo:autojson:[INSERT VERSION HERE]"}<repositories> <!-- Other repositories --> <repository> <id>drtheo-repo</id> <name>DrTheo's Repo</name> <url>https://theo.is-a.dev/maven-repo/</url> </repository></repositories>
<dependencies> <dependency> <groupId>dev.drtheo</groupId> <artifactId>autojson</artifactId> <version>[INSERT VERSION HERE]</version> </dependency></dependencies>Using AutoJSON
Now you can import AutoJSON in your project. First, you have to set up the AutoJSON instance.
import dev.drtheo.autojson.AutoJSON;
class YourClass {
public void someMethod() { AutoJSON auto = new AutoJSON(); auto.setLayer(2); // 0 by default; sets the current layer. auto.setLogMissingEntries(false); // true by default. auto.setSafeInstancing(true); // false by default. }}You can also customize it, as seen in the example above!