websphinx
Class Form
java.lang.Object
|
+--websphinx.Region
|
+--websphinx.Element
|
+--websphinx.Link
|
+--websphinx.Form
- All Implemented Interfaces:
- websphinx.util.Prioritized
- public class Form
- extends Link
<FORM> element in an HTML page.
Constructor Summary |
Form(websphinx.Tag startTag,
websphinx.Tag endTag,
java.net.URL base)
Make a LinkElement from a start tag and end tag and a base URL (for relative references). |
Method Summary |
int |
getMethod()
Get the method used to access this link. |
java.net.URL |
makeQuery()
Construct the query that would be submitted if the form's SUBMIT button were pressed. |
java.net.URL |
makeQuery(websphinx.FormButton button)
Construct the query that would be submitted if the specified button were pressed. |
protected java.net.URL |
urlFromHref(websphinx.Tag tag,
java.net.URL base)
Construct the URL for this form, from its start tag and a base URL (for relative references). |
Methods inherited from class websphinx.Link |
discardContent, disconnect, FileToURL, getDepth, getDirectory, getDirectoryURL, getDirectoryURL, getDownloadParameters, getFile, getFilename, getHost, getPage, getPageURL, getPageURL, getParentURL, getParentURL, getPort, getPriority, getProtocol, getQuery, getRef, getServiceURL, getServiceURL, getStatus, getURL, relativeTo, relativeTo, replaceHref, setDepth, setDownloadParameters, setPage, setPriority, setStatus, setText, toDescription, toText, toURL, toURLDelimiters, URLToFile |
Methods inherited from class websphinx.Element |
enumerateHTMLAttributes, getChild, getEndTag, getHTMLAttribute, getHTMLAttribute, getNext, getParent, getSibling, getStartTag, getTagName, hasHTMLAttribute |
Methods inherited from class websphinx.Region |
enumerateObjectLabels, findEnd, findStart, getEnd, getField, getFields, getLabel, getLabel, getLength, getNumericLabel, getObjectLabel, getObjectLabels, getRootElement, getSource, getStart, hasAllLabels, hasAllLabels, hasAnyLabels, hasAnyLabels, hasLabel, removeLabel, setField, setFields, setLabel, setLabel, setObjectLabel, span, toHTML, toString, toTags |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Form
public Form(websphinx.Tag startTag,
websphinx.Tag endTag,
java.net.URL base)
throws java.net.MalformedURLException
- Make a LinkElement from a start tag and end tag and a base URL (for relative references).
The tags must be on the same page.
- Parameters:
startTag
- Start tag of elementendTag
- End tag of elementbase
- Base URL used for relative references
urlFromHref
protected java.net.URL urlFromHref(websphinx.Tag tag,
java.net.URL base)
throws java.net.MalformedURLException
- Construct the URL for this form, from its start tag and a base URL (for relative references).
- Overrides:
urlFromHref
in class Link
- Parameters:
tag
- Start tag of form.base
- Base URL used for relative references
- Returns:
- URL to which the button points
java.net.MalformedURLException
getMethod
public int getMethod()
- Get the method used to access this link.
- Overrides:
getMethod
in class Link
- Returns:
- GET or POST.
makeQuery
public java.net.URL makeQuery()
- Construct the query that would be submitted if the form's SUBMIT button were pressed.
- Returns:
- a URL representing the submitted form, or null if the form cannot be represented as a URL.
makeQuery
public java.net.URL makeQuery(websphinx.FormButton button)
- Construct the query that would be submitted if the specified button were pressed.
- Parameters:
button
- form button that triggers the submission.
- Returns:
- a URL representing the submitted form, or null if the form cannot be represented as a URL.