Jackson JSON Processor
  1. Jackson JSON Processor
  2. JACKSON-253

JAXB compat: consider supporting @XmlAnyElement + @XmlElementRef

    Details

    • Number of attachments :
      0

      Description

      (note: for more information, check out JDK Javadocs for javax.xml.bind.annotation.XmlAnyElement, section "Using XmlAnyElement with XmlElementRef")

      Earlier, assumption was that XmlAnyElement would only work with DOM Element type. But after re-reading javadocs (and seeing some references to it from JAXB samples), I realized that there are multiple use cases; and one of them would fit with the new Polymorphic Type Handling. Currently only @XmlElements annotation is considered for PTH; but @XmlAnyElement should ideally be also supported.

        Activity

        Hide
        Tatu Saloranta added a comment -

        On a related note: perhaps @XmlAnyAttribute should also be supported in some fashion – maybe as an alias for @JsonAnySetter?

        Show
        Tatu Saloranta added a comment - On a related note: perhaps @XmlAnyAttribute should also be supported in some fashion – maybe as an alias for @JsonAnySetter?
        Hide
        Tatu Saloranta added a comment -

        Existing support for @XmlElementRefs was almost enough, just needed to add support for using name() property.

        Show
        Tatu Saloranta added a comment - Existing support for @XmlElementRefs was almost enough, just needed to add support for using name() property.
        Hide
        Adam Ringel added a comment -

        Does this resolution mean that only @XmlElementRef is going to be supported and not @XmlAnyElement? We need @XmlAnyElement to get a list of name/values for undefined elements.

        Show
        Adam Ringel added a comment - Does this resolution mean that only @XmlElementRef is going to be supported and not @XmlAnyElement? We need @XmlAnyElement to get a list of name/values for undefined elements.
        Hide
        Tatu Saloranta added a comment -

        If you think that would be a useful addition, you can go ahead and create a new Jira; closing does not prevent further work. Creating a new entry would allow adding specific description of benefits, use case and so on.

        Show
        Tatu Saloranta added a comment - If you think that would be a useful addition, you can go ahead and create a new Jira; closing does not prevent further work. Creating a new entry would allow adding specific description of benefits, use case and so on.

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Tatu Saloranta
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: