|
|||||
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
com.gargoylesoftware.htmlunit.javascript.host.Location
public class Location
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 | |
---|---|
Location()
Creates an instance. |
Method Summary | |
---|---|
java.lang.Object |
getDefaultValue(java.lang.Class hint)
Return the javascript default value of this object. |
void |
initialize(Window window)
Initializes the object. |
void |
jsxFunction_assign(java.lang.String url)
Loads the new HTML document corresponding to the specified URL. |
void |
jsxFunction_reload(boolean force)
Reloads the current page, possibly forcing retrieval from the server even if the browser cache contains the latest version of the document. |
void |
jsxFunction_replace(java.lang.String url)
Reloads the window using the specified URL. |
java.lang.String |
jsxFunction_toString()
Returns the location URL. |
java.lang.String |
jsxGet_hash()
Returns the hash portion of the location URL (the portion following the '#'). |
java.lang.String |
jsxGet_host()
Returns the host portion of the location URL (the '[hostname]:[port]' portion). |
java.lang.String |
jsxGet_hostname()
Returns the hostname portion of the location URL. |
java.lang.String |
jsxGet_href()
Returns the location URL. |
java.lang.String |
jsxGet_pathname()
Returns the pathname portion of the location URL. |
java.lang.String |
jsxGet_port()
Returns the port portion of the location URL. |
java.lang.String |
jsxGet_protocol()
Returns the protocol portion of the location URL, including the trailing ':'. |
java.lang.String |
jsxGet_search()
Returns the search portion of the location URL (the portion following the '?'). |
void |
jsxSet_hash(java.lang.String hash)
Sets the hash portion of the location URL (the portion following the '#'). |
void |
jsxSet_host(java.lang.String host)
Sets the host portion of the location URL (the '[hostname]:[port]' portion). |
void |
jsxSet_hostname(java.lang.String hostname)
Sets the hostname portion of the location URL. |
void |
jsxSet_href(java.lang.String newLocation)
Set the location URL to an entirely new value. |
void |
jsxSet_pathname(java.lang.String pathname)
Sets the pathname portion of the location URL. |
void |
jsxSet_port(java.lang.String port)
Sets the port portion of the location URL. |
void |
jsxSet_protocol(java.lang.String protocol)
Sets the protocol portion of the location URL. |
void |
jsxSet_search(java.lang.String search)
Sets the search portion of the location URL (the portion following the '?'). |
java.lang.String |
toString()
Returns the string value of the location, which is the full URL string. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
get, getBooleanArg, getClassName, getDomNodeOrDie, getDomNodeOrNull, getHtmlElementOrDie, getHtmlElementOrNull, getIntArg, getObjectArg, getStringArg, makeScriptableFor, setDomNode, setHtmlElement |
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, wait, wait, wait |
Constructor Detail |
---|
public Location()
Method Detail |
---|
public java.lang.Object getDefaultValue(java.lang.Class hint)
getDefaultValue
in interface org.mozilla.javascript.Scriptable
getDefaultValue
in class SimpleScriptable
hint
- A hint as to the format of the default value. Ignored in this case.
public void initialize(Window window)
window
- The window that this location belongs to.public void jsxFunction_assign(java.lang.String url) throws java.io.IOException
url
- The location of the new HTML document to load.
java.io.IOException
- If loading the specified location fails.public void jsxFunction_reload(boolean force) throws java.io.IOException
force
- If true, force reload from server; otherwise, may reload from cache.
java.io.IOException
- When there is a problem reloading the page.public void jsxFunction_replace(java.lang.String url) throws java.io.IOException
url
- The new URL to use to reload the window.
java.io.IOException
- When there is a problem loading the new page.public java.lang.String jsxFunction_toString()
public java.lang.String jsxGet_hash()
public java.lang.String jsxGet_host()
public java.lang.String jsxGet_hostname()
public java.lang.String jsxGet_href()
public java.lang.String jsxGet_pathname()
public java.lang.String jsxGet_port()
public java.lang.String jsxGet_protocol()
public java.lang.String jsxGet_search()
public void jsxSet_hash(java.lang.String hash) throws java.lang.Exception
hash
- The new hash portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_host(java.lang.String host) throws java.lang.Exception
host
- The new host portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_hostname(java.lang.String hostname) throws java.lang.Exception
hostname
- The new hostname portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_href(java.lang.String newLocation) throws java.io.IOException
newLocation
- The new location URL.
java.io.IOException
- If loading the specified location fails.public void jsxSet_pathname(java.lang.String pathname) throws java.lang.Exception
pathname
- The new pathname portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_port(java.lang.String port) throws java.lang.Exception
port
- The new port portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_protocol(java.lang.String protocol) throws java.lang.Exception
protocol
- The new protocol portion of the location URL.
java.lang.Exception
- If an error occurs.public void jsxSet_search(java.lang.String search) throws java.lang.Exception
search
- The new search portion of the location URL.
java.lang.Exception
- If an error occurs.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |