Pivot
  1. Pivot
  2. PIVOT-324

WTKXSerializer get method enhancement

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: wtk-wtkx
    • Labels:
      None

      Description

      Method get() of class WTKXSerializer returns value of type Object, you see:
      http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtkx/WTKXSerializer.html#get(java.lang.String)

      As demostrated in documentation it cause code like this: (http://incubator.apache.org/pivot/1.3/tutorials/push_buttons.html)
      private PushButton pushButton = null;
      ...
      pushButton = (PushButton)wtkxSerializer.get("pushButton");

      In an alternative way, get() method may be declared as:
      <T> T get(String key)

      { //implementation }

      This way client code will be just:
      pushButton = wtkxSerializer.get("pushButton");

      so the type-case will be implicit. This feature is widely used in HtmlUnit framework and I find it quite neat.
      May be it coult be adopted to pivot project

        Activity

        Dmitry Mamonov created issue -
        Greg Brown made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Greg Brown [ gbrown ]
        Resolution Won't Fix [ 2 ]
        Greg Brown made changes -
        Resolution Won't Fix [ 2 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Greg Brown made changes -
        Fix Version/s 1.4 [ 12314166 ]
        Affects Version/s 1.3 [ 12313779 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Greg Brown made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Greg Brown
            Reporter:
            Dmitry Mamonov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development