Namespace JUL

It holds the utility methods used by JUL

Namespace Summary
Constructor Attributes Constructor Name and Description
 
JUL
JUL global namespace

Method Summary

Namespace Detail

JUL
JUL global namespace

Field Detail

<static> {Object} JUL.nsRoot
This allows setting a default root namespace instead of the global one
<static> {String} JUL.version
JUL version

Method Detail

  • <private> <static> {Function} JUL._getAutoInstance(oNSRoot)
    Gets the JUL instance getter function for a given namespace root, with caching
    Parameters:
    {Object} oNSRoot Optional
    Namespace root
    Returns:
    {Function} Instance getter
  • <private> <static> {String} JUL._square2dots(sNS, sDotEsc)
    Converts a path with square brackets into a dotted path. Use a backslash to escape a square bracket inside segments.
    Parameters:
    {String} sNS
    Input path
    {String} sDotEsc Optional
    If specified, the escaped dots will be replaced with this string
    Returns:
    {String} Output path
  • <static> {Object} JUL.apply(oSource, oAdd, bDontReplace, aFilterOut, aFilterIn)
    Applies an object or an array of objects to a given object
    Parameters:
    {Object} oSource
    The source object to apply to
    {Object} oAdd
    An Object or array of Objects to apply
    {Boolean} bDontReplace
    Set it to true to don't replace existing members
    {Array} aFilterOut Optional
    If not null, the keys in this array will not be applied over
    {Array} aFilterIn Optional
    If not null, only the keys in this array will be applied over
    Returns:
    {Object} The source object with the applied members
  • <static> {Object} JUL.get(sPath, oRoot)
    Retrieves a member specified by a dotted path
    Parameters:
    {String} sPath
    The dotted path or object reference to retrieve
    {Object} oRoot Optional
    An optional object where to start the search from
    Returns:
    {Object} The requested member or undefined if not found
  • <static> {Object} JUL.getInstance(oChild)
    Gets the JUL instance associated with a child object (e.g. a parser, a reference)
    Parameters:
    {Object} oChild
    Child object
    Returns:
    {Object} JUL instance or null if not available
  • <static> {Function} JUL.makeCaller(oScope, fCall, bAppendThis)
    Creates a wrapper that will call a certain function in a specific scope. Useful for ensuring that a callback will get the desired scope.
    Parameters:
    {Object} oScope
    The scope to call the given function in
    {Mixed} fCall
    The function to be called. If a string or an index, it will be the oScope method with that name.
    {Boolean} bAppendThis Optional
    If true, the actual calling context will be added as the last parameter of the called function
    Returns:
    {Function} The caller function
  • <static> {Object} JUL.ns(sPath, oInit, oRoot)
    Creates the specified namespace, and optionally initializes it
    Parameters:
    {String} sPath
    The dotted path for the namespace
    {Object} oInit Optional
    An optional initializer
    {Object} oRoot Optional
    The root object where to start from
    Returns:
    {Object} The created or existing namespace
  • <static> {String} JUL.trim(sText, sWhat, bLeftOrRight)
    Trims a string at one or both ends
    Parameters:
    {String} sText
    The string to trim
    {String} sWhat Optional
    String pattern to match at the ends, it defaults to whitespace
    {Boolean} bLeftOrRight Optional
    If true trims left, if false trims right, if not specified trims at both ends
    Returns:
    {String} Trimmed string
  • <static> {String} JUL.typeOf(oData)
    Returns the name of the object's native constructor
    Parameters:
    {Mixed} oData
    An object to get the native constructor name from
    Returns:
    {String} The native constructor name