| com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
All known Subclasses: com.gargoylesoftware.htmlunit.javascript.host.XMLSerializer, com.gargoylesoftware.htmlunit.javascript.host.XMLDOMParseError, com.gargoylesoftware.htmlunit.javascript.host.History, com.gargoylesoftware.htmlunit.javascript.host.XSLTemplate, com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject, com.gargoylesoftware.htmlunit.javascript.host.Range, com.gargoylesoftware.htmlunit.javascript.host.Style, com.gargoylesoftware.htmlunit.javascript.HTMLOptionsCollection, com.gargoylesoftware.htmlunit.javascript.host.Node, com.gargoylesoftware.htmlunit.javascript.host.Event, com.gargoylesoftware.htmlunit.javascript.host.Stylesheet, com.gargoylesoftware.htmlunit.javascript.host.Popup, com.gargoylesoftware.htmlunit.javascript.host.Screen, com.gargoylesoftware.htmlunit.javascript.host.Location, com.gargoylesoftware.htmlunit.javascript.host.XPathResult, com.gargoylesoftware.htmlunit.javascript.host.XMLAttribute, com.gargoylesoftware.htmlunit.javascript.host.XSLTProcessor, com.gargoylesoftware.htmlunit.javascript.host.Navigator, com.gargoylesoftware.htmlunit.javascript.host.DOMParser, com.gargoylesoftware.htmlunit.javascript.host.BoxObject, com.gargoylesoftware.htmlunit.javascript.HTMLCollection, com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest, com.gargoylesoftware.htmlunit.javascript.host.SimpleArray, com.gargoylesoftware.htmlunit.javascript.host.XPathNSResolver, com.gargoylesoftware.htmlunit.javascript.host.Attribute, com.gargoylesoftware.htmlunit.javascript.host.StyleSheetList, com.gargoylesoftware.htmlunit.javascript.host.TextRectangle, com.gargoylesoftware.htmlunit.javascript.host.Window, com.gargoylesoftware.htmlunit.javascript.host.MimeType, com.gargoylesoftware.htmlunit.javascript.host.DOMImplementation, com.gargoylesoftware.htmlunit.javascript.NamedNodeMap,
SimpleScriptable | public class SimpleScriptable extends ScriptableObject (Code) | | A javascript object for a Location
version: $Revision: 2132 $ author: Mike Bowler author: David K. Taylor author: Marc Guillemot author: Chris Erskine author: Daniel Gredler author: Ahmed Ashour |
Method Summary | |
public Object | get(String name, Scriptable start) Get a named property from the object.
Normally HtmlUnit objects don't need to overwrite this method as properties are defined
on the prototypes from the xml configuration. | public static boolean | getBooleanArg(int index, Object[] args, boolean defaultValue) Return the boolean value at the specified location in the argument list. | public String | getClassName() | public Object | getDefaultValue(Class hint) Return the javascript default value of this object. | final public DomNode | getDomNodeOrDie() Return the DOM node that corresponds to this javascript object or throw
an exception if one cannot be found. | final public DomNode | getDomNodeOrNull() Return the DOM node that corresponds to this javascript object
or null if a node hasn't been set. | public static int | getIntArg(int index, Object[] args, int defaultValue) Return the int value at the specified location in the argument list. | final protected Log | getLog() | public static Object | getObjectArg(int index, Object[] args, Object defaultValue) Return the value at the specified location in the argument list. | protected Scriptable | getPrototype(Class javaScriptClass) | protected SimpleScriptable | getScriptableFor(Object object) Return the javascript object that corresponds to the specified object.
New javascript objects will be created as needed. | protected Scriptable | getStartingScope() Gets the scriptable used at starting scope for the execution of current script. | public static String | getStringArg(int index, Object[] args, String defaultValue) Return the string value at the specified location in the argument list. | protected Transformer | getTransformerScriptableFor() | protected Window | getWindow() Gets the window that is the top scope for this object. | protected static Window | getWindow(Scriptable s) Gets the window that is the top scope for the specified object.
Parameters: s - The JavaScript object whose associated window is to be returned. | protected Object | getWithPreemption(String name) Called by
SimpleScriptable.get(String,Scriptable) to allow retrieval of the property before the prototype
chain is searched.
IMPORTANT: This method is invoked *very* often by Rhino. | public SimpleScriptable | makeScriptableFor(DomNode domNode) | public void | setDomNode(DomNode domNode) | protected void | setDomNode(DomNode domNode, boolean assignScriptObject) | public void | setHtmlElement(HtmlElement htmlElement) |
get | public Object get(String name, Scriptable start)(Code) | | Get a named property from the object.
Normally HtmlUnit objects don't need to overwrite this method as properties are defined
on the prototypes from the xml configuration. In some cases where "content" of object
has priority compared to the properties consider using utility
SimpleScriptable.getWithPreemption(String) .
For fallback case just implement
ScriptableWithFallbackGetter .
|
getBooleanArg | public static boolean getBooleanArg(int index, Object[] args, boolean defaultValue)(Code) | | Return the boolean value at the specified location in the argument list. If the index is larger
than the argument array then return the default value.
Parameters: index - The index into the argument list. Parameters: args - The argument list. Parameters: defaultValue - The default value to be used. The specified boolean or the default value. |
getClassName | public String getClassName()(Code) | | Return the javascript class name
The javascript class name |
getDefaultValue | public Object getDefaultValue(Class hint)(Code) | | Return the javascript default value of this object. This is the javascript equivalent
of a toString() in java.
Parameters: hint - A hint as to the format of the default value. Ignored in this case. The default value. |
getDomNodeOrDie | final public DomNode getDomNodeOrDie() throws IllegalStateException(Code) | | Return the DOM node that corresponds to this javascript object or throw
an exception if one cannot be found.
The DOM node exception: IllegalStateException - If the DOM node could not be found. |
getDomNodeOrNull | final public DomNode getDomNodeOrNull()(Code) | | Return the DOM node that corresponds to this javascript object
or null if a node hasn't been set.
The DOM node or null |
getIntArg | public static int getIntArg(int index, Object[] args, int defaultValue)(Code) | | Return the int value at the specified location in the argument list. If the index is larger
than the argument array then return the default value.
Parameters: index - The index into the argument list. Parameters: args - The argument list. Parameters: defaultValue - The default value to be used. The specified int or the default value. |
getLog | final protected Log getLog()(Code) | | Return the log that is being used for all scripting objects
The log. |
getObjectArg | public static Object getObjectArg(int index, Object[] args, Object defaultValue)(Code) | | Return the value at the specified location in the argument list. If the index is larger
than the argument array then return the default value.
Parameters: index - The index into the argument list. Parameters: args - The argument list. Parameters: defaultValue - The default value to return if the arg wasn't specified. The specified object or null |
getPrototype | protected Scriptable getPrototype(Class javaScriptClass)(Code) | | Get the prototype object for the given host class
Parameters: javaScriptClass - the host class the prototype |
getScriptableFor | protected SimpleScriptable getScriptableFor(Object object)(Code) | | Return the javascript object that corresponds to the specified object.
New javascript objects will be created as needed. If a javascript object
cannot be created for a domNode then NOT_FOUND will be returned.
Parameters: object - a DomNode or a WebWindow The javascript object or NOT_FOUND |
getStringArg | public static String getStringArg(int index, Object[] args, String defaultValue)(Code) | | Return the string value at the specified location in the argument list. If the index is larger
than the argument array then return the default value.
Parameters: index - The index into the argument list. Parameters: args - The argument list. Parameters: defaultValue - The default value to return if the arg wasn't specified. The specified string or null |
getTransformerScriptableFor | protected Transformer getTransformerScriptableFor()(Code) | | Gets a transformer getting the scriptable element for an HtmlElement
the transformer. |
getWindow | protected Window getWindow() throws RuntimeException(Code) | | Gets the window that is the top scope for this object.
The window associated with this object. throws: RuntimeException - If the window cannot be found, which should never occur. |
getWindow | protected static Window getWindow(Scriptable s) throws RuntimeException(Code) | | Gets the window that is the top scope for the specified object.
Parameters: s - The JavaScript object whose associated window is to be returned. The window associated with the specified JavaScript object. throws: RuntimeException - If the window cannot be found, which should never occur. |
getWithPreemption | protected Object getWithPreemption(String name)(Code) | | Called by
SimpleScriptable.get(String,Scriptable) to allow retrieval of the property before the prototype
chain is searched.
IMPORTANT: This method is invoked *very* often by Rhino. If you override this method, the implementation
needs to be as fast as possible!
Parameters: name - the property name Scriptable.NOT_FOUND if not found |
makeScriptableFor | public SimpleScriptable makeScriptableFor(DomNode domNode)(Code) | | Builds a new the javascript object that corresponds to the specified object.
Parameters: domNode - the dom node for which a JS object should be created The javascript object |
setDomNode | public void setDomNode(DomNode domNode)(Code) | | Set the DOM node that corresponds to this javascript object
Parameters: domNode - The DOM node |
setDomNode | protected void setDomNode(DomNode domNode, boolean assignScriptObject)(Code) | | Set the DOM node that corresponds to this javascript object
Parameters: domNode - The DOM node Parameters: assignScriptObject - If true, call setScriptObject on domNode |
setHtmlElement | public void setHtmlElement(HtmlElement htmlElement)(Code) | | Set the html element that corresponds to this javascript object
Parameters: htmlElement - The html element |
|
|