|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.ScriptableWrapper
public class ScriptableWrapper
Simple wrapper to make "normal" object scriptable according to specific configuration and allowing use of index properties. TODO: Configuration of the properties and functions should occur from the XML configuration according to the browser to simulate.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
ScriptableWrapper(net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
Object javaObject,
Class<?> staticType)
Constructs a wrapper for the java object. |
Method Summary | |
---|---|
Object |
get(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
|
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
|
String |
getClassName()
|
Object |
getDefaultValue(Class<?> hint)
|
Object |
getWrappedObject()
Gets the java object made availabe to JavaScript through this wrapper. |
boolean |
has(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
|
protected Object |
invoke(Method method)
Invokes the method on the wrapped object. |
protected Object |
invoke(Method method,
Object[] args)
Invokes the method on the wrapped object. |
String |
jsToString()
To use as "toString" function in JavaScript. |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, equivalentValues, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public ScriptableWrapper(net.sourceforge.htmlunit.corejs.javascript.Scriptable scope, Object javaObject, Class<?> staticType)
scope
- the scope of the executing scriptjavaObject
- the javaObject to wrapstaticType
- the static type of the objectMethod Detail |
---|
public Object get(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.get(java.lang.String,net.sourceforge.htmlunit.corejs.javascript.Scriptable)
public boolean has(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
has
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
has
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.has(java.lang.String, net.sourceforge.htmlunit.corejs.javascript.Scriptable)
protected Object invoke(Method method)
method
- the method to invoke
protected Object invoke(Method method, Object[] args)
method
- the method to invokeargs
- the argument to pass to the method
public Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.get(int, net.sourceforge.htmlunit.corejs.javascript.Scriptable)
public Object getDefaultValue(Class<?> hint)
getDefaultValue
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getDefaultValue
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.getDefaultValue(java.lang.Class)
public String jsToString()
public String getClassName()
getClassName
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getClassName
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.getClassName()
public Object getWrappedObject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |