When Is the Reference Useful?

When you are writing your own custom JavaScript class to plug into uitags. Accepting custom JavaScript classes is uitags' way of making itself extensible.

For example, the <sort /> tag by default uses the JavaScript class uiSort_OptionComparatorStrategy as its comparator. You can provide your own comparator strategy by specifying it as a tag attribute: <sort comparator="new MyJsComparator();" />

uitags expects the custom MyJsComparator to have the same public methods as uiSort_OptionComparatorStrategy. uitags developers use the following naming convention to denote the scope of a method/variable:

  • If the name starts with one underscore (_), the scope is private.
  • If the name starts with two underscores (__), the scope is package-private.
  • If the name does not start with an underscore, the scope is public.

Where Is It?