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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.0.11
    • 5.0.14
    • tapestry-core
    • 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).

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: