Yamler
Yamler
This API enables you the easy usage of Java Object bound into YAML. This does not rely on Bukkit Configuration API. So this should work a little bit faster. (I use it to build YML based Databases with it)
Maven Repository: http://nexus.cube-space.net/content/groups/public/
<dependency> <groupId>net.cubespace</groupId> <artifactId>Yamler-Core</artifactId> <version>1.5.1-SNAPSHOT</version> </dependency>
How to use it:
- Create a Class which extends net.cubespace.Yamler.Config.Config
- Create Fields which are either public or private (not final or transient or static)
- Create a Constructor and set the CONFIG_FILE and CONFIG_HEADER (CONFIG_HEADER is optional)
- To tell the Config to load invoke Config.init()
So you end up having a Config Class like this:
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:
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:
try { dbConfig.save(); } catch(InvalidConfigurationException ex) { System.out.println("Error in saving the Config YML"); ex.printStackTrace(); }
Quote:This plugin utilises Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
- A unique identifier
- The server's version of Java
- Whether the server is in offline or online mode
- The plugin's version
- The server's version
- The OS version/name and architecture
- The core count for the CPU
- The number of players online
- The Metrics version
Opting out of this service can be done by editing plugins/Plugin Metrics/config.yml and changing opt-out to true.
good work and nice idea!
I just wanted to say this is a great plugin taking advantage of Java Reflection. I use Json (more specifically gson) to take care of my data saving/handling, and Yamler as my configuration manager. It is truly useful, and simple to use.
I WANT DONATE FOR U !!! :D BEST IDEA !!
wow nice job
Stunning the most useful api, I have found on DBO. Not that am using that version. Went for the full Yamaler version due to my requirements.
One thing there doesn't appear to be any javadocs in most of the recent versions. Well there is just the source hasn't been commented. Went through all the source to understand how it works.
Once again thinks for this am currently in the middle of re factoring the 40K lines of code in my plugin to take advantage of this as it has 8 different config files. Sure i noticed it but can't remember are the file handlers auto closing ?