treblereel / mapper-xml

j2cl/gwt compatible XML marshallers
Apache License 2.0
3 stars 3 forks source link

Proposed changes.. #79

Closed manstis closed 3 years ago

manstis commented 3 years ago

TypeUtils.java

1) Explicit check for name AND type

BeanDefinition.java

2) Fix for xmlType.propOrder always returning [""] by default.

3) Proposed fix for this type of XSD construct:

@XmlType(name = "", propOrder = {
    "extension",
    "sequenceReference",
    "time"
})
@XmlRootElement(name = "ConsequentSequence")
public class ConsequentSequence {

    @XmlElement(name = "Extension")
    protected List<Extension> extension;
    @XmlElement(name = "SequenceReference", required = true)
    protected SequenceReference sequenceReference;
    @XmlElement(name = "Time")
    protected Time time;
...

Where the XMLElement name looked up by PropertyDefinition.getPropertyName() does not match the propOrder names. In this scenario I check whether the Java property name matches the propOrder entry.. IDK if you can think of a better approach?

manstis commented 3 years ago

Added super sourced javax.xml.bind.annotation.adapters.CollapsedStringAdapter

treblereel commented 3 years ago

@manstis thank you ! very cool