migrate from JibX to JAXB for XML binding / codegen
JibX is losing support in the community - not finding willing partners for maintainance - while JAXB has become the standard XML binding framework for Java. We plan to migrate / switch to JAXB for object un/marshalling and most likely datatype code generation.
refs: #7832: Removed jibx and BCEL dependencies, now that JAXB has been benchmarked against JiBX favorably. Refactored TypeSmaplesTestCase to use the TypeMarshaller, instead of JiBX classes.
#2 Updated by Rob Nahf over 5 years ago
basic marshalling will create an empty type (no values set) that we've determined is problematic when unmarshalling, for example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
if using schema code generation, we would have to add special handling to get desired behavior (throwing an exception).
#4 Updated by Rob Nahf over 5 years ago
xjc did not generate classes for 4 types in dataoneTypes.xsd:
Were these ever JiBX code generated?
ObjectFormatIDentifier could probably be because it was declared a simpleType instead of a complexType. (Or could it be that the class name is so looooooooong. :-) )
#5 Updated by Rob Nahf over 5 years ago
Was able to get the TypeMarshallerTestCase to pass on a JAXB-based TypeMarshaller class (refactored from the JiBX-based on in d1_common_java), and with JAXB annotated copies of existing service.type classes.
- need to make sure package-info.java is in the types package
- need to make sure the @XMLRootElement(name = "lowerCaseClassName")
- make sure the List element properties use the un-list name for the property, i.e.: List subject, instead of List<Subject subjectList
Still need to adapt all of the types with XMLAnnotations...
Still need to verify that Dates marshall correctly
Still need to verify that lists become lists...
#6 Updated by Rob Nahf over 5 years ago
Finished conversion from JibX to JAXB, using only a cache for the marshalling contexts as recommended. Caching the Marshallers and unmarsahllers themselves was tested, but didn't lead to a performance gain, so that code was removed. (The complication of adding ThreadLocals to make the TypeMarshaller thread safe was the primary consideration against leaving it in.
Removed JibX and BCEL configurations from pom.xml, as well as d1-jibx-extensions as a project dependency.