jaxb
  1. jaxb
  2. JAXB-272

allow @XmlElementWrapper on any property

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1 EA1
    • Fix Version/s: 2.3
    • Component/s: spec
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      272

      Description

      Currently, @XmlElementWrapper is only allowed on Collection properties. It
      would be useful to allow this annotation on any property to supported nested XML
      that doesn't necessarily make sense in the object model. For example:

      @XmlElementWrapper(name="sessionTimeout")
      @XmlElement(name="seconds")
      private Seconds sessionTimeout;

      To produce:

      <sessionTimeout><seconds>60</seconds></sessionTimeout>

        Activity

        Hide
        kohsuke added a comment -

        Agreed this is useful. But it's a spec feature.

        Show
        kohsuke added a comment - Agreed this is useful. But it's a spec feature.

          People

          • Assignee:
            Martin Grebac
            Reporter:
            lpurvis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: