Class Index | File Index

Classes


Namespace myfaces._impl.core._Runtime


Defined in: _Runtime.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
myfaces._impl.core._Runtime.addOnLoad(func, func)
onload wrapper for chaining the onload cleanly
<static>  
myfaces._impl.core._Runtime.applyToGlobalNamespace(nms, �obj)
applies an object to a namespace basically does what bla.my.name.space = obj does note we cannot use var myNameSpace = fetchNamespace("my.name.space") myNameSpace = obj because the result of fetch is already the object which the namespace points to, hence this function
<static>  
myfaces._impl.core._Runtime.assertType(probe, theType)
general type assertion routine
<static>  
myfaces._impl.core._Runtime.delegateObj(newCls, delegateObj, protoFuncs, nmsFuncs)
delegation pattern usage: this.delegateObject("my.name.space", delegate, { constructor_ :function(bla, bla1) { _T._callDelegate("constructor", bla1); }, myFunc: function(yyy) { DoSomething; _T._callDelegate("someOtherFunc", yyyy); }, null }); or usage var newClass = this.delegateObject( function (var1, var2) { _T._callDelegate("constructor", var1,var2); }; ,delegateObject); newClass.prototype.myMethod = function(arg1) { _T._callDelegate("myMethod", arg1,"hello world");
<static>  
myfaces._impl.core._Runtime.exists(root, subNms)
check if an element exists in the root also allows to check for subelements usage _T.exists(rootElem,"my.name.space")
<static>  
myfaces._impl.core._Runtime.fetchNamespace(nms)
fetches the object the namespace points to
<static>  
myfaces._impl.core._Runtime.getGlobalConfig(configName, defaultValue)
fetches a global config entry
<static>  
myfaces._impl.core._Runtime.getLanguage(lOverride)
returns the internationalisation setting for the given browser so that we can i18n our messages
<static>  
myfaces._impl.core._Runtime.getLocalOrGlobalConfig(configName, localOptions, defaultValue)
gets the local or global options with local ones having higher priority if no local or global one was found then the default value is given back
<static>  
myfaces._impl.core._Runtime.getXHRLvl()
determines the xhr level which either can be 1 for classical level1 1.5 for mozillas send as binary implementation 2 for xhr level 2
<static>  
myfaces._impl.core._Runtime.getXHRObject()
encapsulated xhr object which tracks down various implementations of the xhr object in a browser independent fashion (ie pre 7 used to have non standard implementations because the xhr object standard came after IE had implemented it first newer ie versions adhere to the standard and all other new browsers do anyway)
<static>  
myfaces._impl.core._Runtime.globalEval(�code)
global eval on scripts
<static>  
myfaces._impl.core._Runtime.isString(it)
Backported from dojo a failsafe string determination method (since in javascript String != "" typeof alone fails!)
<static>  
myfaces._impl.core._Runtime.loadScriptByBrowser(src, type, defer, charSet, async)
load script functionality which utilizes the browser internal script loading capabilities
<static>  
myfaces._impl.core._Runtime.loadScriptEval(src, type, defer, charSet, async)
loads a script and executes it under a global scope
<static>  
myfaces._impl.core._Runtime.pluginClass(classNms, protoFuncs, overWrite)
convenience method which basically replaces an existing class with a new one under the same namespace, note all old functionality will be presereced by pushing the original class into an new nampespace
<static>  
myfaces._impl.core._Runtime.require(nms,)
A dojo like require to load scripts dynamically, note to use this mechanism you have to set your global config param myfacesScriptRoot to the root of your script files (aka under normal circumstances resources/scripts)
<static>  
myfaces._impl.core._Runtime.reserveNamespace(nms, obj)
reserves a namespace in the specific scope usage: if(_T.reserve("org.apache.myfaces.MyUtils")) { org.apache.myfaces.MyUtils = function() { } } reserves a namespace and if the namespace is new the function itself is reserved or: _T.reserve("org.apache.myfaces.MyUtils", function() { .
<static>  
myfaces._impl.core._Runtime.singletonDelegateObj(newCls, delegateObj, protoFuncs, nmsFuncs)
delegation pattern which attached singleton generation
<static>  
myfaces._impl.core._Runtime.singletonExtendClass(newCls, extendsCls, protoFuncs, nmsFuncs)
Extends a class and puts a singleton instance at the reserved namespace instead of its original class
Namespace Detail
myfaces._impl.core._Runtime
Method Detail
<static> myfaces._impl.core._Runtime.addOnLoad(func, func)
onload wrapper for chaining the onload cleanly
Parameters:
func
the function which should be added to the load chain (note we cannot rely on return values here, hence jsf.util.chain will fail)
func

<static> myfaces._impl.core._Runtime.applyToGlobalNamespace(nms, �obj)
applies an object to a namespace basically does what bla.my.name.space = obj does note we cannot use var myNameSpace = fetchNamespace("my.name.space") myNameSpace = obj because the result of fetch is already the object which the namespace points to, hence this function
Parameters:
{String} nms
the namespace to be assigned to
{Any} �obj
the object to be assigned

<static> myfaces._impl.core._Runtime.assertType(probe, theType)
general type assertion routine
Parameters:
probe
the probe to be checked for the correct type
theType
the type to be checked for

<static> myfaces._impl.core._Runtime.delegateObj(newCls, delegateObj, protoFuncs, nmsFuncs)
delegation pattern usage: this.delegateObject("my.name.space", delegate, { constructor_ :function(bla, bla1) { _T._callDelegate("constructor", bla1); }, myFunc: function(yyy) { DoSomething; _T._callDelegate("someOtherFunc", yyyy); }, null }); or usage var newClass = this.delegateObject( function (var1, var2) { _T._callDelegate("constructor", var1,var2); }; ,delegateObject); newClass.prototype.myMethod = function(arg1) { _T._callDelegate("myMethod", arg1,"hello world");
Parameters:
{String} newCls
the new class name to be generated
{Object} delegateObj
the delegation object
{Map} protoFuncs
the prototype functions which should be attached
{Map} nmsFuncs
the namespace functions which should be attached to the namespace

<static> myfaces._impl.core._Runtime.exists(root, subNms)
check if an element exists in the root also allows to check for subelements usage _T.exists(rootElem,"my.name.space")
Parameters:
{Object} root
the root element
{String} subNms
the namespace

<static> myfaces._impl.core._Runtime.fetchNamespace(nms)
fetches the object the namespace points to
Parameters:
{String} nms
the namespace which has to be fetched
Returns:
the object the namespace points to or null if nothing is found

<static> myfaces._impl.core._Runtime.getGlobalConfig(configName, defaultValue)
fetches a global config entry
Parameters:
{String} configName
the name of the configuration entry
{Object} defaultValue
Returns:
either the config entry or if none is given the default value

<static> myfaces._impl.core._Runtime.getLanguage(lOverride)
returns the internationalisation setting for the given browser so that we can i18n our messages
Parameters:
lOverride
Returns:
a map with following entires:
  • language: the lowercase language iso code
  • variant: the uppercase variant iso code
null is returned if the browser fails to determine the language settings

<static> myfaces._impl.core._Runtime.getLocalOrGlobalConfig(configName, localOptions, defaultValue)
gets the local or global options with local ones having higher priority if no local or global one was found then the default value is given back
Parameters:
{String} configName
the name of the configuration entry
{String} localOptions
the local options root for the configuration myfaces as default marker is added implicitely
{Object} defaultValue
Returns:
either the config entry or if none is given the default value

<static> myfaces._impl.core._Runtime.getXHRLvl()
determines the xhr level which either can be 1 for classical level1 1.5 for mozillas send as binary implementation 2 for xhr level 2

<static> myfaces._impl.core._Runtime.getXHRObject()
encapsulated xhr object which tracks down various implementations of the xhr object in a browser independent fashion (ie pre 7 used to have non standard implementations because the xhr object standard came after IE had implemented it first newer ie versions adhere to the standard and all other new browsers do anyway)
Returns:
the xhr object according to the browser type

<static> myfaces._impl.core._Runtime.globalEval(�code)
global eval on scripts
Parameters:
{String} �code

<static> {boolean} myfaces._impl.core._Runtime.isString(it)
Backported from dojo a failsafe string determination method (since in javascript String != "" typeof alone fails!)
Parameters:
{Object} it
the object to be checked for being a string
Returns:
{boolean} true in case of being a string false otherwise

<static> myfaces._impl.core._Runtime.loadScriptByBrowser(src, type, defer, charSet, async)
load script functionality which utilizes the browser internal script loading capabilities
Parameters:
{String} src
the source of the script
{String} type
the type of the script
{Boolean} defer
defer true or false, same as the javascript tag defer param
{String} charSet
the charset under which the script has to be loaded
async

<static> myfaces._impl.core._Runtime.loadScriptEval(src, type, defer, charSet, async)
loads a script and executes it under a global scope
Parameters:
{String} src
the source of the script
{String} type
the type of the script
{Boolean} defer
defer true or false, same as the javascript tag defer param
{String} charSet
the charset under which the script has to be loaded
{Boolean} async
tells whether the script can be asynchronously loaded or not, currently not used

<static> myfaces._impl.core._Runtime.pluginClass(classNms, protoFuncs, overWrite)
convenience method which basically replaces an existing class with a new one under the same namespace, note all old functionality will be presereced by pushing the original class into an new nampespace
Parameters:
classNms
the namespace for the class, must already be existing
protoFuncs
the new prototype functions which are plugins for the old ones
overWrite
if set to true replaces the old funcs entirely otherwise just does an implicit inheritance with super being remapped TODO do not use this function yet it needs some refinement, it will be interesting later anyway

<static> myfaces._impl.core._Runtime.require(nms,)
A dojo like require to load scripts dynamically, note to use this mechanism you have to set your global config param myfacesScriptRoot to the root of your script files (aka under normal circumstances resources/scripts)
Parameters:
{String} nms,
the subnamespace to be required

<static> {boolean} myfaces._impl.core._Runtime.reserveNamespace(nms, obj)
reserves a namespace in the specific scope usage: if(_T.reserve("org.apache.myfaces.MyUtils")) { org.apache.myfaces.MyUtils = function() { } } reserves a namespace and if the namespace is new the function itself is reserved or: _T.reserve("org.apache.myfaces.MyUtils", function() { .. }); reserves a namespace and if not already registered directly applies the function the namespace note for now the reserved namespaces reside as global maps justl like jsf.js but we also use a speedup index which is kept internally to reduce the number of evals or loops to walk through those namespaces (eval is a heavy operation and loops even only for namespace resolution introduce (O)2 runtime complexity while a simple map lookup is (O)log n with additional speedup from the engine.
Parameters:
{String} nms
obj
Returns:
{boolean} true if it was not provided false otherwise for further action

<static> myfaces._impl.core._Runtime.singletonDelegateObj(newCls, delegateObj, protoFuncs, nmsFuncs)
delegation pattern which attached singleton generation
Parameters:
newCls
the new namespace object to be generated as singletoin
delegateObj
the object which has to be delegated
protoFuncs
the prototype functions which are attached on prototype level
nmsFuncs
the functions which are attached on the classes namespace level

<static> myfaces._impl.core._Runtime.singletonExtendClass(newCls, extendsCls, protoFuncs, nmsFuncs)
Extends a class and puts a singleton instance at the reserved namespace instead of its original class
Parameters:
{function|String} newCls
either a unnamed function which can be assigned later or a namespace
{function} extendsCls
the function class to be extended
{Object} protoFuncs
(Map) an optional map of prototype functions which in case of overwriting a base function get an inherited method
nmsFuncs

Documentation generated by JsDoc Toolkit 2.1.0 on Tue Sep 06 2011 21:09:21 GMT-0500 (COT)