marcusaram / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
1 stars 0 forks source link

introduce Tag class #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently (version 1.5) SnakeYAML is using simple Strings to represent tags.
Even though it works it would be more flexible and safe to introduce a 
special class for tags.

Original issue reported on code.google.com by py4fun@gmail.com on 11 Jan 2010 at 8:45

GoogleCodeExporter commented 9 years ago
Done.
Very low level stuff (Scanner, Parser, Events) still use strings. The tag can 
be null 
there.
Nodes and public interface should only use Tag class. A Tag instance can never 
be null.

Unfortunately the change breaks backwards-compatibility. In order to satisfy 
compiler 
we have to use 'new Tag("!!str")' instead of simple '"!!str"'.

Original comment by py4fun@gmail.com on 11 Jan 2010 at 8:49