You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Piotr Kołaczkowski (Updated JIRA)" <ji...@apache.org> on 2011/11/01 15:43:32 UTC

[jira] [Updated] (PIVOT-813) BXML annotation should work for JavaBean properties

     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Kołaczkowski updated PIVOT-813:
-------------------------------------

    Description: 
Consider the following code:

public class Bean 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.


  was:
Consider the following code:

public class Bean {

  @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.


    
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0.1
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>
> Consider the following code:
> public class Bean 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira