public
Description: JvYAMLb is a YAML processing library for Java, used by JRuby
Homepage: http://code.google.com/p/jvyamlb
Clone URL: git://github.com/olabini/jvyamlb.git
Add basic support for positioning of scalar values in the composer.
olabini (author)
Mon Jun 23 06:31:29 -0700 2008
commit  b3f8cb658063d21e1743bbd7f0232a8d8e0743ad
tree    2c2161705bd0d39f965fc37ebf852862c8ce91eb
parent  2c1ffd2f24e12e2dc75b2ae1855c5e5cdcdd024c
...
36
37
38
39
 
40
41
42
...
85
86
87
 
 
 
 
88
89
90
...
107
108
109
110
 
111
112
113
...
36
37
38
 
39
40
41
42
...
85
86
87
88
89
90
91
92
93
94
...
111
112
113
 
114
115
116
117
0
@@ -36,7 +36,7 @@ import org.jruby.util.ByteList;
0
  * @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
0
  */
0
 public class ComposerImpl implements Composer {
0
- private Parser parser;
0
+ protected Parser parser;
0
     private Resolver resolver;
0
     private Map anchors;
0
 
0
@@ -85,6 +85,10 @@ public class ComposerImpl implements Composer {
0
     private final static boolean[] FALS = new boolean[]{false};
0
     private final static boolean[] TRU = new boolean[]{true};
0
 
0
+ protected Node getScalar(final String tag, final ByteList value, final char style, final Event e) {
0
+ return new ScalarNode(tag,value,style);
0
+ }
0
+
0
     public Node composeNode(final Node parent, final Object index) {
0
         if(parser.peekEvent() instanceof AliasEvent) {
0
             final AliasEvent event = (AliasEvent)parser.getEvent();
0
@@ -107,7 +111,7 @@ public class ComposerImpl implements Composer {
0
             if(tag == null || tag.equals("!")) {
0
                 tag = resolver.resolve(ScalarNode.class,ev.getValue(),ev.getImplicit());
0
             }
0
- node = new ScalarNode(tag,ev.getValue(),ev.getStyle());
0
+ node = getScalar(tag,ev.getValue(),ev.getStyle(),ev);
0
             if(null != anchor) {
0
                 anchors.put(anchor,node);
0
             }

Comments

    No one has commented yet.