November 2004
Intermediate to advanced
1024 pages
27h 50m
English
You have seen several examples (for instance, in Chapters 4 and 10) of the use of property files to describe the configuration of a program. A property file contains a set of name/value pairs, such as
fontname=Times Roman fontsize=12 windowsize=400 200 color=0 50 100
You can use the Properties class to read in such a file with a single method call. That's a nice feature, but it doesn't really go far enough. In many cases, the information that you want to describe has more structure than the property file format can comfortably handle. Consider the fontname/fontsize entries in the example. It would be more object oriented to have a single entry:
font=Times Roman 12
But then parsing the font description gets ugly—you have to ...
Read now
Unlock full access