snakeyaml

Has anyone succesfully loaded a YAML file using SnakeYAML from a local Maven repo?

If I reference the SnakeYAML jar directly from a test program (see bottom), everything works. If I'm inside my Maven-created project, I get the following output from my unit tests: java.lang.NoSuchMethodError: java.util.LinkedList.push(Ljava/lang/Object;)V at org.yaml.snakeyaml.scanner.ScannerImpl.addIndent(ScannerImpl.java:482) ...

Serializing ENUM Singleton

I'm trying to serialize an ENUM singleton instance (as described by Joshua Bloch in his book Effective Java) to a file. The ENUM instance is a simple JavaBean as this: public enum ElvisFan implements Serializable{ INSTANCE; private int totalSongsListened; private ElvisFan(){ totalSongsListened=0; } public void set(int v){ ...

SnakeYAML: How to disable underscore stripping when parsing?

Here's my problem. I have YAML doc that contains the following pair: run_ID: 2010_03_31_101 When this get's parsed at org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlInt:159 underscores get stripped and Constructor returns Long 20100331101 instead of unmodified String "2010_03_31_101" that I really need. QUESTION: How ca...

YAML - one to many object graph

Hello, I use a snakeyaml (java) based parser to write a test case, and couldn't figure out how to properly build the graph. Any help, highly appreciated. thanks. RuntimeException occured : Cannot load fixture test-data.yml: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of models.Priority.des...

Bidirectional relationship in yaml

Hello, I am using Snakeyaml for building my domain graph. I couldn't find the right syntax for it. Please see the domain model, and the yaml. public class Person { String fullname; @OneToMany(mappedBy="person",cascade=CascadeType.ALL) public List<Role> roles; } public class Role { public RoleType roleType...

Yaml ambiquity; intendation spaces and empty node

I wrote: a: -b -c Parser understood it as: !!map { ? !!str "a" : !!seq [ !!str "b", !!str "c" ] } But I meant: !!map { ? !!str "a" : !!null "" } !!seq [ !!str "b", !!str "c" ] The specification says: The “-”, “?” and “:” characters used to denote block collection entries are perceived by peopl...