Sign Håvard Rast Blok

Field Value Loader

Field Value Loader

Loads and saves field values in an object based on a file saved by java.util.Properties. This means that you can easily add a human readable property file to your program, without having to bother using many command line parameters or implement your own text parsers. The current version also features methods for setting or getting values directly from a Properties object, if this is needed.

Download

Download from SourceForge SourceForge.net Logo

Usage

Suppose you have an object my, of this class

class MyClass {
  String name;
  int age;
}

and this file fields.txt:


name = Havard
age = 24

You would load the values from the file into the object by calling:
FieldValueLoader.loadFile( "fields.txt", my )

To save the values of my to a human readable file, use:
FieldValueLoader.saveFile( "p.txt", my )



site: Håvard Rast Blok
mail:
updated: 20 July 2006