Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixklauke/babylon
A simple experimental config format in json style but with comments and some random cool features
https://github.com/felixklauke/babylon
babylon config experimental json lightweight sasuke sasukekawaii simple yaml
Last synced: 5 days ago
JSON representation
A simple experimental config format in json style but with comments and some random cool features
- Host: GitHub
- URL: https://github.com/felixklauke/babylon
- Owner: felixklauke
- License: mit
- Created: 2017-07-23T06:30:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T10:53:42.000Z (over 2 years ago)
- Last Synced: 2024-12-17T16:48:01.096Z (about 2 months ago)
- Topics: babylon, config, experimental, json, lightweight, sasuke, sasukekawaii, simple, yaml
- Language: Java
- Size: 12.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Babylon
Caution: Still under heavy development
Babylon is a little experimental not really ready to use config format. It aims to replace
json as a config format in my projects by providing the following features:
- Highly human readable
- Add comments for all values (Main reason of replacing json)
- Simple and clean API
- Managing the config as a model with annotationsOn config initialization babylon will check for an existing config and will create a new one
if the file does not exist or read the known config.# Installation / Usage
- Install [Maven](http://maven.apache.org/download.cgi)
- Clone this repo
- Instal: ```mvn clean install```**Maven dependencies**
```xml
de.felix_klauke
babylon
1.0-SNAPSHOT```
# Example
_Model:_
```java
public class TestConfig extends Config {private String test;
private String meh;
@Skip
private MessageManager messageManager;
public TestConfig(String test, String meh, MessageManager messageManager) {
this.test = test;
this.meh = meh;
this.messageManager = messageManager;
}public TestConfig() {
}
}
```_Initialize config:_
```java
Babylon babylon = BabylonFactory.createBabylon();
Config config = new TestConfig();babylon.initializeConfig(config, new File("config.bbl"));
```_Comments in the config:_
```java
@Comment( "I am a commented field" )
private String name = "SasukeKawaiiTheKing";
```Comments will look like this:
```
{
# I am a commented field
name: "SasukeKawaiiTheKing"
}
```_Renaming fields:_
```java
@Name( "customName" )
private String name = "SasukeKawaiiTheKing";
```Renaming will look like this:
```
{
customName: "SasukeKawaiiTheKing"
}
```