|
||||||||||
| 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.
| 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, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isReadOnlySettable, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 object| Method Detail |
|---|
public Object get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptableget in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectScriptableObject.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.Scriptablehas in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectScriptableObject.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.Scriptableget in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectScriptableObject.get(int, net.sourceforge.htmlunit.corejs.javascript.Scriptable)public Object getDefaultValue(Class<?> hint)
getDefaultValue in interface net.sourceforge.htmlunit.corejs.javascript.ScriptablegetDefaultValue in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectScriptableObject.getDefaultValue(java.lang.Class)public String jsToString()
public String getClassName()
getClassName in interface net.sourceforge.htmlunit.corejs.javascript.ScriptablegetClassName in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectScriptableObject.getClassName()public Object getWrappedObject()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||