ivantrendafilov / confucius Goto Github PK
View Code? Open in Web Editor NEWA lightweight Java configuration library
License: Apache License 2.0
A lightweight Java configuration library
License: Apache License 2.0
Hello,
I think, there's a big problem with InjectableConfiguration class. The logic of this class is very simply
setProperty(FILE_PARAM, filePath);
setProperty(CONTEXT_PARAM, context);
but it doesn't work cause of the fact const
private final static String FILE_PATH;
is already set up when AbstractConfiguration is loaded
static {
FILE_PATH = System.getProperty(FILE_PARAM);
...
and this cannot be changed. So this class is useless for now ๐
If its a standard ini format, then the current codebase doesnt provide a way to get all sections in that configuration file (Something similar to HierarchicalINIConfiguration#getSections) . Is there a reason why this was not included.
It would be quite helpful to have something like that if we wanted to go through a list of sections and get values from each of them. I have a usecase where my section names are user-written, but each of those sections have a key that is standardized. Without getting the sections (or setting the conf.context), I wont be able to get those values right now.
I have a patch to get this in Parser.java but wasnt sure what was the best way to expose it as an API.
Thanks!
Section of front page:
"First, you need the Confucius jar file on your classpath. Confucius is available from Maven Central, so add to your pom.xml (or manually download ..." <--- this link on front page
For now, Confucius cannot load configuration from jar's (just because Parser reads file, and doesn't accept e.g. InputStream)
BufferedReader br = new BufferedReader(new FileReader(filename));
It should be gr8, if I can ask Confucius for configuration from my resources
Configurable config = InjectableConfiguration(this.getClass.getResourceAsStream("my-config.cfg", "Default")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.