Skip to main content
4 events
when toggle format what by license comment
Aug 16, 2012 at 16:40 comment added Gary I'd favour some kind of JAXB or YAML approach to simplify all the details.
Aug 16, 2012 at 10:30 comment added enzom83 @StuartMarks: Well, my first idea was just to write a Config class and use the approach proposed by you: getInt(), getByte(), getBoolean(), etc.. Continuing with this idea, I first read all the values ​​and I could associate each value to a flag (this flag is false if a problem occurred during deserialization, for example parsing errors). After that, I could start a validation phase for all ​​loaded values and set any default values.
Aug 16, 2012 at 7:40 comment added Martijn Verburg Hey Stuart, nice to see you here :-). I'll add to Stuarts answer that I think your tempalte idea will work in Java if you use Generics to strongly type, so you could have Setting<T> as an option as well.
Aug 16, 2012 at 7:25 history answered Stuart Marks CC BY-SA 3.0