Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-5534

Codegen should use (un)marshallers for XmlElement(Ref) type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • Authoring Tooling
    • None

      I have split the POJOs generation into two phases:-

      1. Generate interfaces only
      2. Generate classes that implement the interfaces

      This will support the UI working against the interfaces but different (un)marshallers for different versions of the concrete classes generated for different versions of the domain (DMN, PMML, BPMN etc) model.

      For example:-

      I generate this using JAXB:-

      @XmlAccessorType(XmlAccessType.FIELD)
      @XmlType(name = "", propOrder = {
          "extension",
          "attribute"
      })
      @XmlRootElement(name = "Characteristic")
      @JsType
      @GWT3Export
      public class Characteristic
          implements com.anstis.pmml.model.api.Characteristic
      {
      
          @XmlElement(name = "Extension", type = Extension.class)
          protected List<com.anstis.pmml.model.api.Extension> extension;
          @XmlElement(name = "Attribute", required = true, type = Attribute.class)
          protected List<com.anstis.pmml.model.api.Attribute> attribute;
      ...
      

      The class Characteristic implements the interface ...api.Characteristic.

      The mapper-xml code generation is trying to use (un)marshallers based on the field (i.e. the underlying interface, com.anstis.pmml.model.api.AttributeBeanXMLDeserializerImpl) and not the @XmlElement[Ref]'s type, com.anstis.pmml.model.impl.v4_4.AttributeBeanXMLDeserializerImpl.

      JRE's JAXB Reference Implementation (un)marshalls correctly based on @XmlElement[Ref]'s types.

            manstis@redhat.com Michael Anstis
            manstis@redhat.com Michael Anstis
            Dominik Hanak Dominik Hanak
            Dominik Hanak Dominik Hanak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: