Samples

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.

  • ReadStringSample

    This sample presents accessing String type values.

  • ReadPrimitiveSample

    Reading some Java primitive type values.

  • IniSample

    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.

  • StreamSample

    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.

  • DumpSample

    Writing the .ini file received as input to the stand output.

  • NoImportSample

    Using [ini4j] without class level dependency (no Java imports). You may use [ini4j] library as full Preferences implementation for user and system root.

  • ListenerSample

    This advanced sample presents the event-controlled usage. The [ini4j] library fully supports the events defined in Preferences API.

  • BeanSample

    Accessing the whole .ini file as Java Beans-style beans.

  • BeanEventSample

    A sample that demonstrates the handling of the bound bean properties.

  • FromSample

    Marshall Java Beans to Ini.Section.

  • ToSample

    Unmarshall Java Beans from Ini.Section.

  • Using Python like ConfigParser API

    For Python programmers the simlest API to use is ConfigParser. This sample presents accessing .ini files as Python ConfigParser objects.