Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-442

provide setters for optional elements that check for null argument (help not rendering of optional elements)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Version 2.4
    • None
    • None
    • None

    Description

      from issue XMLBEANS-220 it is clear that XMLBeans will generate an optional element declared as nillable="false" with nil="true"
      when the setter of the element is called with null as an argument.

      If a user doesn't want the (optional) element to appear in the XML (because the XML has to validate against a schema) then he has to call unset..() explicitly or never call the setter at all. This litters the code of the user with null checks.

      It would be nice if XMLbeans generates an extra setter which calls unset..() automatically if the argument is null and call the regular setter if the argument is not null.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              janickr Janick Reynders
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: