Is there any tool or library that converts YAML or XML files into Java code?

SpitFireXB360

New Member
Is there a tool or library that converts object serialized into YAML or XML file into Java code creating that object?From technical point of view, I see no difficulties here. Both Yaml and XStream (or other similar tools) needs to find Java class name via reflection, find constructor, invoke it, then find setters and invoke them. Reflection invokes can be replaced by Java code generation that is doing the same. It requires a bit work, however.Does such tool exist? Or maybe someone is developing it and want to share it with public?P.S. Any library with ability to convert given Java object into Java code would fullfill my needs. clarificationI expect the tool to convert example YAML:\[code\]--- !pl.example.Contactname: Nathan Sweetage: 28\[/code\]Or XML:\[code\]<contact> <name>Nathan Sweet</name> <age>28</age></contact>\[/code\]into the code:\[code\]pl.example.Contact contact = new pl.example.Contact();contact.setName("Nathan Sweet");contact.setAge(28);\[/code\]
 
Back
Top