Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-813

BXML annotation should work for JavaBean properties

    Details

      Description

      Consider the following code:

      public class MyComponent extends Panel implements Bindable {

      @BXML
      private String field;

      public void setField(String field)

      { this.field = field; }

      public String getField()

      { return field; }

      // ...
      }

      Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

      Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

        Attachments

        1. custom_panel.bxml.launch
          1.0 kB
          Sandro Martini
        2. pivot_813 - Applet.launch
          1 kB
          Sandro Martini

          Activity

            People

            • Assignee:
              smartini Sandro Martini
              Reporter:
              pkolaczk Piotr Kołaczkowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: