|
From: | Zhi An Ng |
Subject: | Re: [Confuse-devel] GSoC / libConfuse Java |
Date: | Wed, 2 Jul 2014 13:50:40 +0800 |
Thanks for sharing, I'm thinking of using JavaCC [1] to parse and generate a `Conf' object, which you can query for options. E.g. the configuration file has this:
globals {
daemonize = yes
setuid = yes
}
The API will look something like this
Conf gmondConf = Parser.parse(file);
Section globals = gmondConf.getSection("globals");
Option daemonize = globals.getOption("daemonize");
Boolean isDaemonize = daemonize.toBoolean();
However this is different from how libconfuse works. Libconfuse requires you to register each section and options available before parsing, and will return and error when an unknown section is encountered while parsing.
One possible way is to translate libconfuse to Java and add that as a dependency for use in gmetric4j and other projects that uses similar configuration files.
Best,
Zhi An
Hi all,
Zhi An (on CC) is one of the Google Summer of Code students for the
Ganglia project.
He has looked at making a Java parser for libConfuse config files, for
JMXetric to read /etc/ganglia/gmond.conf
Has anybody looked at this in the past?
Are there any other Java libraries that are known to parse libConfuse
format configs?
Would it be OK to contribute this work to the libConfuse Github
repository, so that the C and Java implementations can share the test cases?
Regards,
Daniel
_______________________________________________
Confuse-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/confuse-devel
[Prev in Thread] | Current Thread | [Next in Thread] |