Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-527

add getCurrentElement() to WTKXSerializer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.1
    • wtk
    • None

    Description

      When using new capability in PIVOT-514, sometimes you need to get the enclosing object. While this could be added to the createInstance method, you can also add it as a protected method. The code is below:

      /**

      • Return the enclosing object which is this element's parent's value.
      • @return
        */
        protected Object getEnclosingObject() { return element.parent==null?null:element.parent.value; }

      This allows extensions of the serializer to know what the enclosing object is. From there, the tree can be climbed back to the root.

      It is possible to make instance creation a strategy design pattern, but the subclassing approach is sufficient for now but there are not strong use-cases supporting it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aappddeevv Appddevvv
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: