https://github.com/shateq/inicere
Currently rewritten... Hard working
https://github.com/shateq/inicere
config java toml
Last synced: 2 months ago
JSON representation
Currently rewritten... Hard working
- Host: GitHub
- URL: https://github.com/shateq/inicere
- Owner: shateq
- License: mit
- Created: 2022-01-24T09:53:45.000Z (over 3 years ago)
- Default Branch: dev
- Last Pushed: 2022-11-24T18:50:21.000Z (over 2 years ago)
- Last Synced: 2025-02-05T18:02:11.977Z (4 months ago)
- Topics: config, java, toml
- Language: Java
- Homepage:
- Size: 284 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Experimental concept - Inicere
Lightweight, practical library for working with TOML files.
Goal: Lightweight work multiple files using simple (with event handler)
Table of Contents
1. [Start](#getting-started)
2. [Examples](#examples)
3. [Develop](#develop)
4. [License](#license)
## Getting started
- Explore javadocs: https://shateq.github.io/inicere/
- Check out [Wiki](https://github.com/shateq/inicere/wiki)Add as a dependency
**Gradle**
```groovy
repositories {
maven { url "https://jitpack.io" }
}dependencies {
implementation("cf.shateq:inicere-core:(Version tag)")
}
```## Examples
[Examples](/examples) project
Inicere instance
```java
class A {
@Element("object")
public boolean good = false;public void initialize() {
AnyName object = new AnyName();
// Key-value store
Inicere inicere = new Inicere(Path.of("fileName.toml")); // Simple wayinicere.set("some.key", 3.14);
inicere.get("some.key"); // 3.14// Reflection, requires you to bind an object
Inicere binding = new Inicere.Phi()
.setFile(Path.of("file-name.toml"))
.setObject(object)
.build(); // Hard waybinding.set("object", true);
object.good; // true
}
}
```Class serialization
```java
class B {
void func() {
Inicere paths = new Inicere(Path.of("file-name.toml"));
paths.bind(new DefaultFile());
paths.bound().key$to$integer; // 2paths.set("key.to.integer", 4);
paths.bound().key$to$integer; // 4Inicere sections = new Inicere(new AsAFile());
sections.set("version", "1.0.1");
sections.get("version"); // "1.0.1"
}@DataSection
class DefaultFile {
public boolean bool = false;
public int key$to$integer = 2;
// This field won't be processed
transient String weatherOutside = "appealing";
}@DataSection("as-a-file.toml")
class AsAFile {
String version = "1.0.0";
double pi = 3.14;
}
}
```## Develop
Gradle guides, modules
## License
Licensed under MIT. Check [LICENSE](LICENSE) file for details.