Yaroslav
--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To post to this group, send email to snakeya...@googlegroups.com.
To unsubscribe from this group, send email to snakeyaml-cor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/snakeyaml-core?hl=en.
Constructor constr=new Constructor();constr.setConstruct(Tag.TIMESTAMP, new MyTimestampConstruct());constr.setConstruct(new Tag("!dice"), new ConstructDice());constr.setConstruct(new Tag("!..."), new My...Construct());constr.setMultiConstruct(prefix, new PrefixConstruct(prefix, constr));constr.addTypeDescription(new TypeDescription(MyEntity.class, "!myent"));...Yaml yaml=new Yaml(constr);yaml.addImplicitResolver(new Tag("!dice"), Pattern.compile("\\d+d\\d+"), "123456789");
--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To view this discussion on the web visit https://groups.google.com/d/msg/snakeyaml-core/-/b6JTd9Vb2nkJ.
-Andrey--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To view this discussion on the web visit https://groups.google.com/d/msg/snakeyaml-core/-/FsJkyJGKqocJ.
Yaroslav,your proposal only covers very simple use cases when the custom implementation of the Construct interface does not need to call the main statefull Constructor. (Please be aware that the anchors & aliases and recursive objects can only be registered and managed in one central place - that is why the there is only one main Constructor). Have a look at this example where the custom implementation of the Construct interface calls 'constructScalar':If in this example you simply create a scalar yourself, then in case of an anchor the code will not work: how do you get the reference to the already created object ?
Let us go the standard way (http://code.google.com/p/snakeyaml/wiki/Developing):1) create your clone2) massage the code and fix all the tests3) share with us your ideas
-Andrey--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To view this discussion on the web visit https://groups.google.com/d/msg/snakeyaml-core/-/7TcAF4w8dSwJ.
I do not think I have that deep understanding of SnakeYAML yet. I can easily miss important things like anchors for example. I just expressed an idea. If you do not see it as being useful or feasible then I do not insist on it at all.