Yamler 2.4.0

Easy API for saving and interacting with YAML Configs

  1. geNAZt
    Yamler

    This API enables you the easy usage of Java Object bound into YAML. It works like BungeeYAML but this does not rely on Bukkit Configuration APIs and has some features stripped away.

    !!! Also works in Bukkit/Spigot !!!
    You will find the BungeeCord Version in this Resource.
    The Bukkit Version is on DBO or you can get it via Jenkins.
    Jenkins: http://ci.md-5.net/job/Yamler/

    How to use it:
    1. Create a Class which extends net.cubespace.Yamler.Config.Config
    2. Create Fields which are either public or private (not final or transient or static)
    3. Create a Constructor and set the CONFIG_FILE and CONFIG_HEADER (CONFIG_HEADER is optional)
    4. To tell the Config to load invoke Config.init()

    So you end up having a Config Class like this:
    Code (Java):
    @Getter
    @Setter
    public class Database extends Config {
       public Database(Plugin plugin) {
           CONFIG_HEADER = new String[]{"Configuration of the Database"};
           CONFIG_FILE = new File(plugin.getDataFolder(), "db.yml");
       }

       @Comments({
           "This is the URL of the Database",
           "Must be jdbc:<database engine>:<connection parameter>",
           "For H2 (which is the default file based DB): jdbc:h2:{DIR}thesuit.db",
           "For MySQL: jdbc:mysql://<host>:<port>/<database>"
       })
       private String Url = "jdbc:h2:{DIR}thesuit.db";

       @Comment("The Username which should be used to auth against the Database")
       private String Username = "test";

       @Comment("The Password for the User")
       private String Password = "test";
    }
    You can use it with this:
    Code (Java):
    Database dbConfig = null;
    try {
        dbConfig = new Database(this);
        dbConfig.init();
    } catch(InvalidConfigurationException ex) {
        System.out.println("Your Config YML was wrong");
        ex.printStackTrace();
    }
    To save a Config file:
    Code (Java):
    try {
        dbConfig.save();
    } catch(InvalidConfigurationException ex) {
        System.out.println("Error in saving the Config YML");
        ex.printStackTrace();
    }
    [​IMG]


    In case you found a problem / bug or have a feature request, don't hesitate to let us know! If you are a developer, you can find the source of this plugin on geNAZt's/Cube-Space's GitHub profile. Development builds can be found on md-5's Jenkins system.

    If you like what i do and want to spend me a Cookie:

    [​IMG]

Recent Reviews

  1. LucasxD33
    LucasxD33
    5/5,
    Version: 2.4.0
    Good!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2. MonitorParty
    MonitorParty
    5/5,
    Version: 2.4.0
    Mir gefällt deine API. Sie ist einfach aufgebaut und funktioniert echt spitze! Die 5 Sterne hast du dir auf jeden Fall verdient!
  3. Internalizable
    Internalizable
    5/5,
    Version: 2.4.0
    Thank you so much geNazt for updating this resource! You're a great dev and leader when i was at Gomme, and i had no time to thank you, so here it is, thank you so much.
  4. MumbosHut
    MumbosHut
    5/5,
    Version: 2.3.0
    Awesome API!
    Having forked it on Github and submitted a Pull Request for some of my own Functionality, I hope to bring Yamler from its Bukkit roots to more usage in generic, widespread java; It's innovative, unique, and well designed!
  5. coolv1994
    coolv1994
    5/5,
    Version: 2.3.0
    This is my new favorite way to serialize YAML.
    Fantastic API, well done.
  6. gogobebe2
    gogobebe2
    5/5,
    Version: 2.3.0
    This is actually really useful. Good idea!
  7. XxCoolGamesxX
    XxCoolGamesxX
    5/5,
    Version: 2.3.0
    Awesome Resource! :D
  8. Relicum
    Relicum
    5/5,
    Version: 2.2.3
    Great resource.
  9. marotoweb
    marotoweb
    5/5,
    Version: 2.2.3
    May not receive proper credit, but it remains important for the proper functioning of other plug-in
  10. Summerfeeling
    Summerfeeling
    4/5,
    Version: 2.2.2
    1. geNAZt
      Author's Response
      Thats one way that could work yes. But you normally private the List so you can be sure that all access must go through the getter/setters