Class JObject

Defined in jobject.js

JObject is a featureful object system for Javascript or ECMAScript, primarily intended for use by XBLinJS. Generally, for something like this NIH syndrome hits full force, so I don't really expect anyone to use this. Nevertheless, I document it here, as I intend to use it and others may need to consult this.

JObject abstracts out the parts of the Widget class that aren't really Widget specific, namely:

Like I said, NIH probably means you'll never use this. However, JObjects do work very nicely with Widgets, mostly due to sharing their ideas on .setAttribute and such.

Note that JObjects have no connection to DOM nodes, or in fact anything else; they are pure Javascript/ECMAscript objects.

For reference, "JObject" stands for a Jerf (or Jeremy Bowers) Object; I couldn't think of a better name than Object (which is taken and should not be modified on such a grand scale), or something that was misleading ("SuperObject"?).

Field Summary
          Set to true if this Javascript instance can create properties, false otherwise.
 Object className
          The name of the class of this object.
 Object defaults
          The declared defaults, defaulting to {}, of course.
 Object initOrder
          The initialization order for .init to set the remaining attributes; an Array of strings.
          Indicates whether to auto-create properties.
Constructor Summary
JObject (atts, prototypeOnly)
            JObject - a featureful object system for Javascript/ECMAScript
Method Summary
 void createDefaultProperty(propName)
           If we're in an environment that supports Javascript properties, create a property for "propName" that sets and gets the property using .setAttribute and .getAttribute.
 void declareVariable(varName, varType, value, extra)
           This declares a Variable for this widget.
 Object get()
           Synonym for "getAttribute".
 Object getAttribute(name)
           Gets the chosen attribute through the cascade lookup described in detail in the HTML documentation.
 void init(atts)
           The default JObject initialization routine.
 void initClass()
           A stub func; do class-specific initialization in subclasses.
 void initData(atts)
           This initializes data needed by JObject for bookkeeping.
 void processAtt(atts, name)
           Performs the default processing on the atts parameter for the given attribute.
 void remoteExecute(url, postData, errorInCode, sync)
           Execute a remote script in the context of this object.
 Object set()
           Synonym for ".setAttribute".
 void setAttribute(name, value, extra)
           Sets the chosen attribute through the cascade lookup described in detail in the HTML documentation.

Field Detail




Object className


Object defaults


Object initOrder



Constructor Detail


JObject(atts, prototypeOnly)

Method Detail


void createDefaultProperty(propName)


void declareVariable(varName, varType, value, extra)


Object get()


Object getAttribute(name)


void init(atts)


void initClass()


void initData(atts)


void processAtt(atts, name)