Skip to content

Commit

Permalink
JRE JAXB RI works correctly, using marshallers for @XmlElementRef typ…
Browse files Browse the repository at this point in the history
…es and not field type.
  • Loading branch information
Michael Anstis committed Jul 16, 2021
1 parent 01abbd5 commit 72e84ee
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 149 deletions.
70 changes: 35 additions & 35 deletions marshaller-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
<groupId>org.treblereel.gwt.xml.mapper</groupId>
<artifactId>api</artifactId>
</dependency>
<dependency>
<groupId>org.treblereel.gwt.xml.mapper</groupId>
<artifactId>processor</artifactId>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.treblereel.gwt.xml.mapper</groupId>-->
<!-- <artifactId>processor</artifactId>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->

<!-- GWT3 Mappers (J2CL boiler plate code generation) -->
<dependency>
<groupId>org.treblereel.j2cl.processors</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.treblereel.j2cl.processors</groupId>
<artifactId>processors</artifactId>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.treblereel.j2cl.processors</groupId>-->
<!-- <artifactId>processors</artifactId>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->

</dependencies>

Expand All @@ -46,31 +46,31 @@
<plugins>

<!-- J2CL -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>com.vertispan.j2cl</groupId>
<artifactId>j2cl-maven-plugin</artifactId>
<version>${maven.j2cl.plugin.version}</version>
<configuration>
<compilationLevel>ADVANCED_OPTIMIZATIONS</compilationLevel>
</configuration>
<executions>
<execution>
<id>build-js</id>
<phase>generate-sources</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <version>${maven.compiler.plugin.version}</version>-->
<!-- <configuration>-->
<!-- <source>${maven.compiler.source}</source>-->
<!-- <target>${maven.compiler.target}</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.vertispan.j2cl</groupId>-->
<!-- <artifactId>j2cl-maven-plugin</artifactId>-->
<!-- <version>${maven.j2cl.plugin.version}</version>-->
<!-- <configuration>-->
<!-- <compilationLevel>ADVANCED_OPTIMIZATIONS</compilationLevel>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>build-js</id>-->
<!-- <phase>generate-sources</phase>-->
<!-- <goals>-->
<!-- <goal>build</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->

<!-- Create a source JAR (for now) as this module is still used by the GWT example webapp -->
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.07.16 at 10:37:52 AM BST
// Generated on: 2021.07.16 at 07:47:40 PM BST
//


package com.anstis.pmml.model.api;

import java.util.List;

import org.w3c.dom.Element;

/**
* <p>Java class for anonymous complex type.
Expand All @@ -21,9 +19,6 @@
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;any processContents='skip' maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="extender" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
Expand All @@ -37,31 +32,6 @@
public interface Extension {


/**
* Gets the value of the content property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link String }
*
*
*/
List<IExtension> getContent();

/**
* Gets the value of the extender property.
*
Expand Down
17 changes: 7 additions & 10 deletions marshaller-api/src/main/java/com/anstis/pmml/model/api/Row.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.07.16 at 10:37:52 AM BST
// Generated on: 2021.07.16 at 07:47:40 PM BST
//


package com.anstis.pmml.model.api;

import java.util.List;

import org.w3c.dom.Element;

/**
* <p>Java class for anonymous complex type.
*
Expand All @@ -22,7 +20,7 @@
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;any processContents='skip' maxOccurs="unbounded" minOccurs="2"/&gt;
* &lt;element ref="{http://www.dmg.org/PMML-4_4}Extension" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
Expand All @@ -35,28 +33,27 @@ public interface Row {


/**
* Gets the value of the content property.
* Gets the value of the extension property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the content property.
* This is why there is not a <CODE>set</CODE> method for the extension property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* getExtension().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link String }
* {@link Extension }
*
*
*/
List<IExtension> getContent();
List<Extension> getExtension();

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.07.16 at 10:37:58 AM BST
// Generated on: 2021.07.16 at 07:47:46 PM BST
//


package com.anstis.pmml.model.impl.v4_4;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.anstis.pmml.model.api.IExtension;
import com.anstis.pmml.model.api.ISequence;
import jsinterop.annotations.JsType;
import org.treblereel.j2cl.processors.annotations.GWT3Export;
import org.w3c.dom.Element;

/**
* <p>Java class for anonymous complex type.
Expand All @@ -34,9 +28,6 @@
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;any processContents='skip' maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="extender" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
Expand All @@ -48,56 +39,21 @@
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"content"
})
@XmlType(name = "")
@XmlRootElement(name = "Extension")
@JsType
@GWT3Export
public class Extension
implements ISequence
implements IExtension, ISequence
{

@XmlMixed
@XmlAnyElement
protected List<IExtension> content;
@XmlAttribute(name = "extender")
protected String extender;
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "value")
protected String value;

/**
* Gets the value of the content property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link String }
*
*
*/
public List<IExtension> getContent() {
if (content == null) {
content = new ArrayList<IExtension>();
}
return this.content;
}

/**
* Gets the value of the extender property.
*
Expand Down

0 comments on commit 72e84ee

Please sign in to comment.