I have a series of application properties which all have different types.
The types could include, booleans, dates, timestamps, or strings.
I need to be abl
java.util.Properties
is the easiest way. A Properties
object can be created from a properties file (a file containing properties in the format name=value
) or even a simple XML file. You can modify the object in memory and then write it back to a properties or XML file.
If you need more flexibility in structuring the properties, you can consider designing your own XML configuration file, although it will be a bit more work to read and write. You can however use a marshalling/unmarshalling API like JAXB, XStream etc to make that task easier.
These files can easily be modified manually as well.