Skip to content

XML Parsing: Enum as Element Type #475

Closed

Description

@geri-m

In the current implementation, an enumeration is only support as XML-Attribut, but not as an Element. We should have enumerations also as elements.

Currently this kind of XMLs/PoJos can be parsed/serialized

<?xml version="1.0"?><any attributeEnum="ENUM_1" xmlns="http://www.w3.org/2005/Atom" />"
  public static class AnyTypeEnumAttributeOnly {
    @Key("@attributeEnum")
    public XmlEnumTest.AnyEnum attributeEnum;
  }`

These XMLs/PoJos causes an exception (no Standard constructor for primitiv type).

<?xml version="1.0"?><any xmlns="http://www.w3.org/2005/Atom"><elementEnum>ENUM_3</elementEnum></any>
  public static class AnyTypeEnumElementOnly {
    @Key
    public XmlEnumTest.AnyEnum elementEnum;
  }

Activity

  1. added
    triage me
    on Sep 24, 2018
  2. added
    type: bug
    priority: p2
    on Sep 24, 2018
  3. removed
    triage me
    on Sep 24, 2018
  4. added a commit that references this issue on Oct 9, 2018
  5. added a commit that references this issue on Nov 6, 2018
  6. added
    🚨
    on Apr 6, 2020
  7. added a commit that references this issue on Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨priority: p2type: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions