Re: yaml for java ...
Zenaan Harkness <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Mar 02, 2008 at 04:47:09PM -0800, Thom Nelson wrote:
> I had the same experience, it looked like JvYaml was the preferred library
> but JYaml seems usable and has much better docs. However, it's support for
> different input/output methods, particularly streams and readers/writers,
> needs some work, as I had to do things like:
>
> System.out.println(Yaml.dump(doc));
>
> instead of using the proper APIs. Also, I had to write my own simple stream
> chunking, as the JYaml code didn't appear to be working. However, the
> complete lack of docs for JvYaml, as well as its dormant state, makes it way
> less attractive. On the other hand, it is a 1.1 compliant parser, which is
> possibly why the Yaml home page points to it. There's nothing on the JYaml
> page that says what version of Yaml it supports, which probably means it's
> still 1.0.
In my experience, this is correct. JvYaml is 1.1 (or reasonably close)
and has support for TAG, object refs, Java object de/serialization. At
the end of the day, it just works. Yes, the docs are light.
(Sorry, it's been too long since I used JYaml, so I can't say which of
those functions it supports.)
Please post questions if you need on JvYaml, and when I am near my
computer, I am happy to answer as best I can.
I am using JvYaml in the following pipeline:
Driver: JvYaml (yaml 1.1) file + StringTemplate file => Output ("view") file
My Driver class is written in Java naturally, loads the yaml file into
appropriate (for my ST needs) java class instances ("deserialize"), and
then passes that Java bean/ object into the string template which got
loaded, as the parent attribute.
Then, Driver runs sTemplate.toString() to generate the corresponding
output.
This is working _really_ nicely for my needs. Centralisation of data
declarations (declarative entity definition), and flexible output
formatting (pipe the same entity to a different template, and get a
different view/ output.
cheers
zen
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/