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
 Object CAN_CREATE_PROPERTIES
          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.
 Object TRY_TO_CREATE_PROPERTIES
          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

CAN_CREATE_PROPERTIES

Object CAN_CREATE_PROPERTIES

className

Object className

defaults

Object defaults

initOrder

Object initOrder

TRY_TO_CREATE_PROPERTIES

Object TRY_TO_CREATE_PROPERTIES

Constructor Detail

JObject

JObject(atts, prototypeOnly)

Method Detail

createDefaultProperty

void createDefaultProperty(propName)

declareVariable

void declareVariable(varName, varType, value, extra)

get

Object get()

getAttribute

Object getAttribute(name)

init

void init(atts)

initClass

void initClass()

initData

void initData(atts)

processAtt

void processAtt(atts, name)