flexiciousNmsp.TypedObject Class

Parent Previous Next

This class is the base class for all Flexicious classes. It defines the basis for the Object oriented design, by implementing the "implementsOrExtends" function, which is a replacement for the "is" keyword from other OO languages.




Returns a list of strings that represent the object hierarchy for this object.







Returns true if the class name to check is in the list of class names defined for this class.


Name of the class to check



As is obvious, it is very simple to use this class. Below is a sample class that “inherits” from flexiciousNmsp.TypedObject. Pay close attention to the code highlighted in yellow:


* Flexicious

* Copyright 2011, Flexicious LLC




   "use strict";

   var PreferenceInfo, uiUtil = flexiciousNmsp.UIUtils, flxConstants = flexiciousNmsp.Constants;


    * Class added in 2.9 to support multiple preferences. Store information about the

    * name of the preference, whether or not it is a system preference (which cannot be deleted),

    * and the preference string associated with this name.

    * @constructor

    * @class PreferenceInfo

    * @namespace flexiciousNmsp

    * @extends TypedObject




        * Name of the preference

        * @type {String}

        * @property name

        * @default null




        * These cannot be deleted

        * @type {Boolean}

        * @property isSystemPref

        * @default false




        * The actual text (or xml) of preferences.

        * @type {String}

        * @property preferences

        * @default null



       flexiciousNmsp.TypedObject.apply(this); //this ensures that the super constructor gets called.




    * @type {Function}


   flexiciousNmsp.PreferenceInfo = PreferenceInfo; //add to name space

   PreferenceInfo.prototype = new flexiciousNmsp.TypedObject(); //this ensures that the prototype hierarchy is setup for inheritance.

   PreferenceInfo.prototype.typeName = PreferenceInfo.typeName = 'PreferenceInfo';//for quick inspection



    * @return {Array}



       return ["PreferenceInfo","TypedObject"];

   };//This ensures that when you call obj.implementsOrExtends(‘SomeInterfaceOrClassName’), you can get the correct result.