org.mozilla.javascript.regexp
Class NativeRegExpCtor

java.lang.Object
  |
  +--org.mozilla.javascript.ScriptableObject
        |
        +--org.mozilla.javascript.IdScriptable
              |
              +--org.mozilla.javascript.BaseFunction
                    |
                    +--org.mozilla.javascript.NativeFunction
                          |
                          +--org.mozilla.javascript.regexp.NativeRegExpCtor
All Implemented Interfaces:
Function, IdFunctionMaster, Scriptable, java.io.Serializable

public class NativeRegExpCtor
extends NativeFunction

This class implements the RegExp constructor native object. Revision History: Implementation in C by Brendan Eich Initial port to Java by Norris Boyd from jsregexp.c version 1.36 Merged up to version 1.38, which included Unicode support. Merged bug fixes in version 1.39. Merged JSFUN13_BRANCH changes up to 1.32.2.11

Author:
Brendan Eich, Norris Boyd
See Also:
Serialized Form

Fields inherited from class org.mozilla.javascript.NativeFunction
debug_level, debug_srcName, nestedFunctions
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
DONTENUM, EMPTY, PERMANENT, READONLY
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
NativeRegExpCtor()
           
 
Method Summary
 java.lang.Object call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
          Should be overridden.
 Scriptable construct(Context cx, Scriptable scope, java.lang.Object[] args)
          Call the function as a constructor.
 java.lang.String getClassName()
          Get the name of the set of objects implemented by this Java class.
 
Methods inherited from class org.mozilla.javascript.NativeFunction
decompile, getArity, getLength, jsGet_name
 
Methods inherited from class org.mozilla.javascript.BaseFunction
execMethod, getFunctionName, hasInstance, methodArity, setImmunePrototypeProperty
 
Methods inherited from class org.mozilla.javascript.IdScriptable
addAsPrototype, defineProperty, delete, get, getAttributes, has, put, setAttributes
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
 

Constructor Detail

NativeRegExpCtor

public NativeRegExpCtor()
Method Detail

getClassName

public java.lang.String getClassName()
Description copied from interface: Scriptable
Get the name of the set of objects implemented by this Java class. This corresponds to the [[Class]] operation in ECMA and is used by Object.prototype.toString() in ECMA.

See ECMA 8.6.2 and 15.2.4.2.

Overrides:
getClassName in class BaseFunction

call

public java.lang.Object call(Context cx,
                             Scriptable scope,
                             Scriptable thisObj,
                             java.lang.Object[] args)
Description copied from class: BaseFunction
Should be overridden.
Overrides:
call in class BaseFunction
Following copied from interface: org.mozilla.javascript.Function
Parameters:
cx - the current Context for this thread
scope - the scope to execute the function relative to. This is set to the value returned by getParentScope() except when the function is called from a closure.
thisObj - the JavaScript this object
args - the array of arguments
Returns:
the result of the call
Throws:
JavaScriptException - if an uncaught exception occurred while executing the function

construct

public Scriptable construct(Context cx,
                            Scriptable scope,
                            java.lang.Object[] args)
Description copied from interface: Function
Call the function as a constructor. This method is invoked by the runtime in order to satisfy a use of the JavaScript new operator. This method is expected to create a new object and return it.
Overrides:
construct in class BaseFunction
Following copied from interface: org.mozilla.javascript.Function
Parameters:
cx - the current Context for this thread
scope - an enclosing scope of the caller except when the function is called from a closure.
args - the array of arguments
Returns:
the allocated object
Throws:
JavaScriptException - if an uncaught exception occurred while executing the constructor