|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
public class SimpleScriptable
A javascript object for a Location
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
SimpleScriptable()
|
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String name,
org.mozilla.javascript.Scriptable start)
Get a named property from the object. |
static boolean |
getBooleanArg(int index,
java.lang.Object[] args,
boolean defaultValue)
Return the boolean value at the specified location in the argument list. |
java.lang.String |
getClassName()
Return the javascript class name |
java.lang.Object |
getDefaultValue(java.lang.Class hint)
Return the javascript default value of this object. |
DomNode |
getDomNodeOrDie()
Return the DOM node that corresponds to this javascript object or throw an exception if one cannot be found. |
DomNode |
getDomNodeOrNull()
Return the DOM node that corresponds to this javascript object or null if a node hasn't been set. |
HtmlElement |
getHtmlElementOrDie()
Return the html element that corresponds to this javascript object or throw an exception if one cannot be found. |
HtmlElement |
getHtmlElementOrNull()
Return the html element that corresponds to this javascript object or null if an element hasn't been set. |
static int |
getIntArg(int index,
java.lang.Object[] args,
int defaultValue)
Return the int value at the specified location in the argument list. |
static java.lang.Object |
getObjectArg(int index,
java.lang.Object[] args,
java.lang.Object defaultValue)
Return the value at the specified location in the argument list. |
static java.lang.String |
getStringArg(int index,
java.lang.Object[] args,
java.lang.String defaultValue)
Return the string value at the specified location in the argument list. |
SimpleScriptable |
makeScriptableFor(DomNode domNode)
Builds a new the javascript object that corresponds to the specified object. |
void |
setDomNode(DomNode domNode)
Set the DOM node that corresponds to this javascript object |
void |
setHtmlElement(HtmlElement htmlElement)
Set the html element that corresponds to this javascript object |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleScriptable()
Method Detail |
---|
public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
getWithPreemption(String)
.
For fallback case just implement ScriptableWithFallbackGetter
.
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
public static boolean getBooleanArg(int index, java.lang.Object[] args, boolean defaultValue)
index
- The index into the argument list.args
- The argument list.defaultValue
- The default value to be used.
public java.lang.String getClassName()
getClassName
in interface org.mozilla.javascript.Scriptable
getClassName
in class org.mozilla.javascript.ScriptableObject
public java.lang.Object getDefaultValue(java.lang.Class hint)
getDefaultValue
in interface org.mozilla.javascript.Scriptable
getDefaultValue
in class org.mozilla.javascript.ScriptableObject
hint
- A hint as to the format of the default value. Ignored in this case.
public final DomNode getDomNodeOrDie() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the DOM node could not be found.public final DomNode getDomNodeOrNull()
public final HtmlElement getHtmlElementOrDie() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the html element could not be found.public final HtmlElement getHtmlElementOrNull()
public static int getIntArg(int index, java.lang.Object[] args, int defaultValue)
index
- The index into the argument list.args
- The argument list.defaultValue
- The default value to be used.
public static java.lang.Object getObjectArg(int index, java.lang.Object[] args, java.lang.Object defaultValue)
index
- The index into the argument list.args
- The argument list.defaultValue
- The default value to return if the arg wasn't specified.
public static java.lang.String getStringArg(int index, java.lang.Object[] args, java.lang.String defaultValue)
index
- The index into the argument list.args
- The argument list.defaultValue
- The default value to return if the arg wasn't specified.
public SimpleScriptable makeScriptableFor(DomNode domNode)
domNode
- the dom node for which a JS object should be created
public void setDomNode(DomNode domNode)
domNode
- The DOM nodepublic void setHtmlElement(HtmlElement htmlElement)
htmlElement
- The html element
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |