Namespace myfaces._impl._util._Lang
Extends
myfaces._impl.core._Runtime.
Defined in: _Lang.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Object singleton for Language related methods, this object singleton
decorates the namespace myfaces._impl.core._Runtime and adds a bunch of new methods to
what _Runtime provided
|
Method Attributes | Method Name and Description |
---|---|
applyArgs(dest, args, argNames)
helper to automatically apply a delivered arguments map or array
to its destination which has a field "_"
|
|
arrFilter(arr, func)
foreach implementation utilizing the
ECMAScript wherever possible
with added functionality
|
|
arrForEach(arr, func)
foreach implementation utilizing the
ECMAScript wherever possible
with added functionality
|
|
arrIndexOf(arr, element)
adds a EcmaScript optimized indexOf to our mix,
checks for the presence of an indexOf functionality
and applies it, otherwise uses a fallback to the hold
loop method to determine the index
|
|
attr(obj, name, value)
define a property mechanism which is browser neutral
we cannot use the existing setter and getter mechanisms
for now because old browsers do not support them
in the long run we probably can switch over
or make a code split between legacy and new
|
|
byId(reference)
Save document.getElementById (this code was ported over from dojo)
the idea is that either a string or domNode can be passed
|
|
contains(arr, str)
checks if an array contains an element
|
|
createFormDataDecorator(formData)
creates a neutral form data wrapper over an existing form Data element
the wrapper delegates following methods, append
and adds makeFinal as finalizing method which returns the final
send representation of the element
|
|
equalsIgnoreCase(source, destination)
equalsIgnoreCase, case insensitive comparison of two strings
|
|
fetchXMLErrorMessage(xmlContent, xmlContent)
fetches the error message from the xml content
in a browser independent way
|
|
getEvent(evt)
determines the correct event depending
on the browsers state
|
|
getEventTarget(evt)
cross port from the dojo lib
browser save event resolution
|
|
getMessage(key, defaultMessage, key)
returns a given localized message upon a given key
basic java log like templating functionality is included
|
|
hitch(scope, method)
hitch backported from dojo
hitch allows to assign a function to a dedicated scope
this is helpful in situations when function reassignments
can happen
(notably happens often in lazy xhr code)
|
|
initLocale(newLocale)
(re)inits the currently installed
messages so that after loading the main scripts
a new locale can be installed optionally
to our i18n subsystem
|
|
isString(it)
Backported from dojo
a failsafe string determination method
(since in javascript String != "" typeof alone fails!)
|
|
keyValToStr(key, val, delimiter)
transforms a key value pair into a string
|
|
makeException(title, name, callerCls, callFunc, message, message)
creates an exeption with additional internal parameters
for extra information
|
|
mixMaps(dest, src, overwrite, blockFilter, whitelistFilter)
Helper function to merge two maps
into one
|
|
strToArray(it, splitter)
String to array function performs a string to array transformation
|
|
trim(str)
hyperfast trim
http://blog.stevenlevithan.com/archives/faster-trim-javascript
crossported from dojo
|
Namespace Detail
myfaces._impl._util._Lang
Object singleton for Language related methods, this object singleton
decorates the namespace myfaces._impl.core._Runtime and adds a bunch of new methods to
what _Runtime provided
Method Detail
applyArgs(dest, args, argNames)
helper to automatically apply a delivered arguments map or array
to its destination which has a field "_" and a full field
- Parameters:
- dest
- the destination object
- args
- the arguments array or map
- argNames
- the argument names to be transferred
arrFilter(arr, func)
foreach implementation utilizing the
ECMAScript wherever possible
with added functionality
- Parameters:
- arr
- the array to filter
- func
- the closure to apply the function to, with the syntax defined by the ecmascript functionality
function (element<,key, array>)
additional params
- startPos (optional) the starting position
- scope (optional) the scope to apply the closure to
arrForEach(arr, func)
foreach implementation utilizing the
ECMAScript wherever possible
with added functionality
- Parameters:
- arr
- the array to filter
- func
- the closure to apply the function to, with the syntax defined by the ecmascript functionality
function (element<,key, array>)
optional params
- param startPos (optional) the starting position
- param scope (optional) the scope to apply the closure to
arrIndexOf(arr, element)
adds a EcmaScript optimized indexOf to our mix,
checks for the presence of an indexOf functionality
and applies it, otherwise uses a fallback to the hold
loop method to determine the index
- Parameters:
- arr
- the array
- element
- the index to search for
attr(obj, name, value)
define a property mechanism which is browser neutral
we cannot use the existing setter and getter mechanisms
for now because old browsers do not support them
in the long run we probably can switch over
or make a code split between legacy and new
- Parameters:
- obj
- name
- value
byId(reference)
Save document.getElementById (this code was ported over from dojo)
the idea is that either a string or domNode can be passed
- Parameters:
- {Object} reference
- the reference which has to be byIded
contains(arr, str)
checks if an array contains an element
- Parameters:
- {Array} arr
- array
- {String} str
- string to check for
createFormDataDecorator(formData)
creates a neutral form data wrapper over an existing form Data element
the wrapper delegates following methods, append
and adds makeFinal as finalizing method which returns the final
send representation of the element
- Parameters:
- formData
- an array
equalsIgnoreCase(source, destination)
equalsIgnoreCase, case insensitive comparison of two strings
- Parameters:
- source
- destination
fetchXMLErrorMessage(xmlContent, xmlContent)
fetches the error message from the xml content
in a browser independent way
- Parameters:
- xmlContent
- xmlContent
- Returns:
- a map with the following structure {errorMessage: the error Message, sourceText: the text with the error}
getEvent(evt)
determines the correct event depending
on the browsers state
- Parameters:
- evt
- incoming event object (note not all browsers have this)
- Returns:
- an event object no matter what is incoming
getEventTarget(evt)
cross port from the dojo lib
browser save event resolution
- Parameters:
- evt
- the event object (with a fallback for ie events if none is present)
getMessage(key, defaultMessage, key)
returns a given localized message upon a given key
basic java log like templating functionality is included
- Parameters:
- {String} key
- the key for the message
- {String} defaultMessage
- optional default message if none was found Additionally you can pass additional arguments, which are used in the same way java log templates use the params
- key
hitch(scope, method)
hitch backported from dojo
hitch allows to assign a function to a dedicated scope
this is helpful in situations when function reassignments
can happen
(notably happens often in lazy xhr code)
- Parameters:
- {Function} scope
- of the function to be executed in
- {Function} method
- to be executed, the method must be of type function
- Returns:
- whatever the executed method returns
initLocale(newLocale)
(re)inits the currently installed
messages so that after loading the main scripts
a new locale can be installed optionally
to our i18n subsystem
- Parameters:
- newLocale
- locale override
isString(it)
Backported from dojo
a failsafe string determination method
(since in javascript String != "" typeof alone fails!)
- Parameters:
- it
- {|Object|} the object to be checked for being a string
- Returns:
- true in case of being a string false otherwise
keyValToStr(key, val, delimiter)
transforms a key value pair into a string
- Parameters:
- key
- the key
- val
- the value
- delimiter
- the delimiter
makeException(title, name, callerCls, callFunc, message, message)
creates an exeption with additional internal parameters
for extra information
- Parameters:
- {String} title
- the exception title
- {String} name
- the exception name
- {String} callerCls
- the caller class
- {String} callFunc
- the caller function
- {String} message
- the message for the exception
- message
mixMaps(dest, src, overwrite, blockFilter, whitelistFilter)
Helper function to merge two maps
into one
- Parameters:
- {Object} dest
- the destination map
- {Object} src
- the source map
- {boolean} overwrite
- if set to true the destination is overwritten if the keys exist in both maps
- blockFilter
- whitelistFilter
strToArray(it, splitter)
String to array function performs a string to array transformation
- Parameters:
- {String} it
- the string which has to be changed into an array
- {RegExp} splitter
- our splitter reglar expression
- Returns:
- an array of the splitted string
trim(str)
hyperfast trim
http://blog.stevenlevithan.com/archives/faster-trim-javascript
crossported from dojo
- Parameters:
- str