org.mozilla.javascript.regexp

Class NativeRegExp

Implemented Interfaces:
Callable, DebuggableObject, Function, IdFunctionCall, Scriptable, Serializable

public class NativeRegExp
extends IdScriptableObject
implements Function

This class implements the RegExp 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.13
Authors:
Brendan Eich
Norris Boyd

Field Summary

static int
JSREG_FOLD
static int
JSREG_GLOB
static int
JSREG_MULTILINE
static int
MATCH
static int
PREFIX
static int
TEST

Fields inherited from class org.mozilla.javascript.ScriptableObject

DONTENUM, EMPTY, PERMANENT, READONLY

Fields inherited from interface org.mozilla.javascript.Scriptable

NOT_FOUND

Method Summary

Object
call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
Perform the call.
Scriptable
construct(Context cx, Scriptable scope, Object[] args)
Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
protected int
findInstanceIdInfo(String s)
protected int
findPrototypeId(String s)
String
getClassName()
protected String
getInstanceIdName(int id)
protected Object
getInstanceIdValue(int id)
protected int
getMaxInstanceId()
static void
init(Context cx, Scriptable scope, boolean sealed)
protected void
initPrototypeId(int id)
protected void
setInstanceIdValue(int id, Object value)
String
toString()

Methods inherited from class org.mozilla.javascript.IdScriptableObject

activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, execIdCall, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, get, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeId, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdValue

Methods inherited from class org.mozilla.javascript.ScriptableObject

associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isSealed, put, put, putProperty, putProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setParentScope, setPrototype

Field Details

JSREG_FOLD

public static final int JSREG_FOLD
Field Value:
2

JSREG_GLOB

public static final int JSREG_GLOB
Field Value:
1

JSREG_MULTILINE

public static final int JSREG_MULTILINE
Field Value:
4

MATCH

public static final int MATCH
Field Value:
1

PREFIX

public static final int PREFIX
Field Value:
2

TEST

public static final int TEST
Field Value:
0

Method Details

call

public Object call(Context cx,
                   Scriptable scope,
                   Scriptable thisObj,
                   Object[] args)
Perform the call.
Specified by:
call in interface Function
call in interface Callable
Parameters:
cx - the current Context for this thread
scope - the scope to use to resolve properties.
thisObj - the JavaScript this object
args - the array of arguments
Returns:
the result of the call

construct

public Scriptable construct(Context cx,
                            Scriptable scope,
                            Object[] args)
Specified by:
construct in interface Function

execIdCall

public Object execIdCall(IdFunctionObject f,
                         Context cx,
                         Scriptable scope,
                         Scriptable thisObj,
                         Object[] args)
Specified by:
execIdCall in interface IdFunctionCall
Overrides:
execIdCall in interface IdScriptableObject

findInstanceIdInfo

protected int findInstanceIdInfo(String s)
Overrides:
findInstanceIdInfo in interface IdScriptableObject

findPrototypeId

protected int findPrototypeId(String s)
Overrides:
findPrototypeId in interface IdScriptableObject

getClassName

public String getClassName()
Specified by:
getClassName in interface Scriptable
Overrides:
getClassName in interface ScriptableObject

getInstanceIdName

protected String getInstanceIdName(int id)
Overrides:
getInstanceIdName in interface IdScriptableObject

getInstanceIdValue

protected Object getInstanceIdValue(int id)
Overrides:
getInstanceIdValue in interface IdScriptableObject

getMaxInstanceId

protected int getMaxInstanceId()
Overrides:
getMaxInstanceId in interface IdScriptableObject

init

public static void init(Context cx,
                        Scriptable scope,
                        boolean sealed)

initPrototypeId

protected void initPrototypeId(int id)
Overrides:
initPrototypeId in interface IdScriptableObject

setInstanceIdValue

protected void setInstanceIdValue(int id,
                                  Object value)
Overrides:
setInstanceIdValue in interface IdScriptableObject

toString

public String toString()