[jira] [Created] (APEXMALHAR-2536) Support for setters on nested Pojo

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[jira] [Created] (APEXMALHAR-2536) Support for setters on nested Pojo

JIRA jira@apache.org
Tushar Gosavi created APEXMALHAR-2536:

             Summary: Support for setters on nested Pojo
                 Key: APEXMALHAR-2536
                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2536
             Project: Apache Apex Malhar
          Issue Type: Improvement
            Reporter: Tushar Gosavi
            Priority: Minor

Getters support getting values from nested Pojo by adding suitable methods/fields in the chain

for example
class Inner {
  private int b;
  public int getB() { return b; }
  public void setB(int b) { this.b = b; }

class Nested {
  private in a;
  private Inner inner;
  public int getA() { return a; }
  public void getA(int a) { this.a = a; }
  public Inner getInner() { return inner; }
  public void setInner(Inner i) { this.inner = i; }

With above objects  If getter is specified as `inner.b` then the expression is created with
`object.getInner().getB()` which compiles and gives result correctly.

If setter is specified with same expression it fails to compile as inner is a private object.
We plan to include similar functionality for setters by following chain of objects and constructing valid java expressions.

This message was sent by Atlassian JIRA