To make the generated classes of scalaxb really useful for my OfficeOpenXML-related development project, we need some visitor infrastructure. There are several options:
just make this provision for the generated scalaxb code of OpenOffice
add a command line option to the scalaxb generator, to generate a visitor
do something at run-time with macros
In docx4j, approach 1 was taken; see here. One drawback with this approach is that is limited to the OfficeOpen code. Moreover, there is no guaranty that every node is visited.
For jaxb, there is a better solution of type 2: a plug in to the code generator, that creates visitor code. See jaxb-visitor. We could mimic this as a command line option in scalaxb, rather than a plugin.
I think Tolya could also create macro's that generate the visitors at run time. I would prefer the command line option though since that seems easier to understand for slightly less advanced developers.
To make the generated classes of scalaxb really useful for my OfficeOpenXML-related development project, we need some visitor infrastructure. There are several options:
In docx4j, approach 1 was taken; see here. One drawback with this approach is that is limited to the OfficeOpen code. Moreover, there is no guaranty that every node is visited.
For jaxb, there is a better solution of type 2: a plug in to the code generator, that creates visitor code. See jaxb-visitor. We could mimic this as a command line option in scalaxb, rather than a plugin.
I think Tolya could also create macro's that generate the visitors at run time. I would prefer the command line option though since that seems easier to understand for slightly less advanced developers.