This library offers utilities to find and deserialize configuration files depending on the operating system. It also offers configuration objects that have been created from XSD files with xjc.
The application must use a prefix, which defines the properties and environment variables that are used to find the requested file.
Use the FileFinderUtil to find a configuration file, e.g.
File file = FileFinderUtil.findFile("config.xml", "samply");
The FileFinderUtil will now search for the config.xml file in the following locations:
You can also use the JAXBUtil to deserialize an XML file into an object. If possible you should use the ObjectFactory in the JAXBContext, e.g.
Postgresql sql = JAXBUtil.unmarshall(file, JAXBContext.newInstance(ObjectFactory.class), Postgresql.class);
This method will unmarshall the given file into a Postgresql instance.