Montag, 1. März 2010

YAML with snakeyaml

I played a bit around with YAML, here my results. I have used the Java implementation snakeyaml. Unfortunately I have not found a implementation that use Java annotation for mapping between YAML and Java Bean Objects.



The Java bean code, for the configuration:



And here a small test which use snakeyaml to load the YML file:


There is also a cool plugin for YAML editor support in eclipse called yedit, here a screenshot:


Links:

Kommentare:

  1. Hi, I am creator of SnakeYAML. You said you would like to have annotations-controlled API.
    I can tell that SnakeYAML does not use annotations because they far too Java specific and may not help if the source is coming from another language.
    But I recognize a need to help pure Java<->YAML transformations.
    Do you have an idea how the API may look like ? (to say just 'as in XStream' does not help much...)

    -
    Andrey

    AntwortenLöschen
  2. Hi Andrew thanks for your answer. Ok I'll make a proposal for the Annotation stuff ...

    AntwortenLöschen
  3. see my new post http://tux2323.blogspot.com/2010/03/proposal-snakeyaml-annotation-yaml.html for a proposal for a annotation based API ...

    AntwortenLöschen
  4. Hope you are doing great. I am very new to YAML file but as I am salesforce developer, I got bunch of which are in YAML format I need them to convert into CSV format and it should be done at single time. Can you please help me on that.

    AntwortenLöschen