Skip to content

A simple experimental config format in json style but with comments and some random cool features

License

Notifications You must be signed in to change notification settings

felixklauke/babylon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 annotations

On 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
  • Clone this repo
  • Instal: mvn clean install

Maven dependencies

<dependency>
    <groupId>de.felix_klauke</groupId>
    <artifactId>babylon</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Example

Model:

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:

Babylon babylon = BabylonFactory.createBabylon();
Config config = new TestConfig();

babylon.initializeConfig(config, new File("config.bbl"));

Comments in the config:

@Comment( "I am a commented field" )
private String name = "SasukeKawaiiTheKing";

Comments will look like this:

{
	# I am a commented field
	name: "SasukeKawaiiTheKing"
}

Renaming fields:

@Name( "customName" )
private String name = "SasukeKawaiiTheKing";

Renaming will look like this:

{
	customName: "SasukeKawaiiTheKing"
}

About

A simple experimental config format in json style but with comments and some random cool features

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages