Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2404

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


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


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




            • Assignee:
              hlship Howard Lewis Ship
              hlship Howard Lewis Ship


              • Created:

                Issue deployment