Tapestry
  1. Tapestry
  2. TAPESTRY-2404

PropertyConduitSource could build a shared method to "navigate" to the final property

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.14
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Currently, the generated code for a PropertyConduit has a lot of duplication in it; the duplication being the initial check that the root is not null (a sanity check), then casting it from object to the expected expression root type, then following the steps to read properties. The divergence occurs in the final step, where the read gets a property and the write sets a property. Along the way, there are null checks and conversions from primitive to wrapper types.

      This could be encapsulated in a navigate() method that is passed the root object and returns the final object. A simple property expression would just return the root object. "foo.bar" would return property foo (i.e. root.getFoo()), so that the writer could invoke setBar() and the reader could invoke getBar() ... and so forth.

      This will be more important when the expression language grows so support invoking methods with parameters, or generating lists or maps (and other goodness that OGNL used to supply).

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569326 ] jira [ 12590586 ]
        Mark Thomas made changes -
        Workflow jira [ 12430286 ] Default workflow, editable Closed status [ 12569326 ]
        Howard M. Lewis Ship made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 5.1 [ 12312964 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.0.14 [ 12313214 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development