org.mozilla.javascript

Class NativeWith

Implemented Interfaces:
IdFunctionCall, Scriptable, Serializable

public class NativeWith
extends java.lang.Object
implements Scriptable, IdFunctionCall, Serializable

This class implements the object lookup required for the with statement. It simply delegates every action to its prototype except for operations on its parent.

Field Summary

protected Scriptable
parent
protected Scriptable
prototype

Fields inherited from interface org.mozilla.javascript.Scriptable

NOT_FOUND

Constructor Summary

NativeWith(Scriptable parent, Scriptable prototype)

Method Summary

void
delete(String id)
void
delete(int index)
Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned
Object
get(String id, Scriptable start)
Object
get(int index, Scriptable start)
String
getClassName()
Object
getDefaultValue(Class typeHint)
Object[]
getIds()
Scriptable
getParentScope()
Scriptable
getPrototype()
boolean
has(String id, Scriptable start)
boolean
has(int index, Scriptable start)
boolean
hasInstance(Scriptable value)
void
put(String id, Scriptable start, Object value)
void
put(int index, Scriptable start, Object value)
void
setParentScope(Scriptable parent)
void
setPrototype(Scriptable prototype)
protected Object
updateDotQuery(boolean value)
Must return null to continue looping or the final collection result.

Field Details

parent

protected Scriptable parent

prototype

protected Scriptable prototype

Constructor Details

NativeWith

protected NativeWith(Scriptable parent,
                     Scriptable prototype)

Method Details

delete

public void delete(String id)
Specified by:
delete in interface Scriptable

delete

public void delete(int index)
Specified by:
delete in interface Scriptable

execIdCall

public Object execIdCall(IdFunctionObject f,
                         Context cx,
                         Scriptable scope,
                         Scriptable thisObj,
                         Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned
Specified by:
execIdCall in interface IdFunctionCall

get

public Object get(String id,
                  Scriptable start)
Specified by:
get in interface Scriptable

get

public Object get(int index,
                  Scriptable start)
Specified by:
get in interface Scriptable

getClassName

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

getDefaultValue

public Object getDefaultValue(Class typeHint)
Specified by:
getDefaultValue in interface Scriptable

getIds

public Object[] getIds()
Specified by:
getIds in interface Scriptable

getParentScope

public Scriptable getParentScope()
Specified by:
getParentScope in interface Scriptable

getPrototype

public Scriptable getPrototype()
Specified by:
getPrototype in interface Scriptable

has

public boolean has(String id,
                   Scriptable start)
Specified by:
has in interface Scriptable

has

public boolean has(int index,
                   Scriptable start)
Specified by:
has in interface Scriptable

hasInstance

public boolean hasInstance(Scriptable value)
Specified by:
hasInstance in interface Scriptable

put

public void put(String id,
                Scriptable start,
                Object value)
Specified by:
put in interface Scriptable

put

public void put(int index,
                Scriptable start,
                Object value)
Specified by:
put in interface Scriptable

setParentScope

public void setParentScope(Scriptable parent)
Specified by:
setParentScope in interface Scriptable

setPrototype

public void setPrototype(Scriptable prototype)
Specified by:
setPrototype in interface Scriptable

updateDotQuery

protected Object updateDotQuery(boolean value)
Must return null to continue looping or the final collection result.