- The Dumper - JvYAML is now a complete YAML processor, not just a loader.
- Loading and dumping JavaBeans - This feature is necessary for most serious usage of YAML. It allows people to read configuration files right into their bean objects.
- Loading and dumping specific implementations of mappings and sequences. Very nice if you happen to need your mapping to be a TreeMap instead of a HashMap.
- Configuration options to allow 1.0-compatibility with regard to the ! versus !! tag prefixes.
- The simplified interface have been substantially improved, adding several utility methods.
- Lots and lots of bug fixes.
A howto? Oh, you want a guide to the new features? Hmm. Well, OK, but it really isn't much to show. How to dump and object and get the YAML string back:
YAML.dump(obj);
or dump directly to a file:YAML.dump(obj,new FileWriter("/path/to/file.yaml"));or dump with version 1.0 instead of 1.1:
YAML.dump(obj, YAML.options().version("1.0"));dumping a JavaBean:
String beanString = YAML.dump(bean);and loading it back again:
YAML.load(beanString);
That's more or less it. Nothing fancy. Of course, all the different parts underneath is still there, and you can provide your own implementation of YAMLFactory to add your own specific hacks. If you want to dump your object in a special way, you can implement the YAMLNodeCreator interface, and your own object will be in charge of creating the information that should be used to represent your object.
Inga kommentarer:
Skicka en kommentar