Skip to content

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]")
}

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!

See Also: