The simple (but useful) samples you can find here illustrate the usage of [ini4j]. These are small, independent programs that may be translates and run. The build process of [ini4j] guarantees compilability and runability, since no distribution may be created without compiling and running these programs.
This sample presents accessing String type values.
Reading some Java primitive type values.
The [ini4j] library has a simple API: the .ini file is a map of sections, while the section is a map of options. Due to the Java 1.5 generics these are type safe maps.
This sample demonstrates that the Preferences API may be used without a filesystem access. In this case, naturally, there's no way of saving the altered settings, they may only be accessed in the memory.
Writing the .ini file received as input to the stand output.
Using [ini4j] without class level dependency (no Java imports). You may use [ini4j] library as full Preferences implementation for user and system root.
This advanced sample presents the event-controlled usage. The [ini4j] library fully supports the events defined in Preferences API.
Accessing the whole .ini file as Java Beans-style beans.
A sample that demonstrates the handling of the bound bean properties.
Marshall Java Beans to Ini.Section.
Unmarshall Java Beans from Ini.Section.
For Python programmers the simlest API to use is ConfigParser. This sample presents accessing .ini files as Python ConfigParser objects.