websphinx
Class Form

java.lang.Object
  |
  +--websphinx.Region
        |
        +--websphinx.Element
              |
              +--websphinx.Link
                    |
                    +--websphinx.Form
All Implemented Interfaces:
Prioritized

public class Form
extends Link

<FORM> element in an HTML page.


Fields inherited from class websphinx.Link
depth, directory, dp, filename, GET, page, POST, priority, query, ref, status, text, url
 
Fields inherited from class websphinx.Element
child, endTag, parent, sibling, startTag
 
Fields inherited from class websphinx.Region
end, INITIAL_SIZE, names, source, start, TRUE
 
Constructor Summary
Form(Tag startTag, 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.
private  void makeQuery(Element elem, java.lang.StringBuffer query)
           
 java.net.URL makeQuery(FormButton button)
          Construct the query that would be submitted if the specified button were pressed.
private  void passArgument(java.lang.StringBuffer query, java.lang.String name, java.lang.String value)
           
protected  java.net.URL urlFromHref(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, getHrefAttributeName, getPage, getPageURL, getPageURL, getParentURL, getParentURL, getPort, getPriority, getProtocol, getQuery, getRef, getServiceURL, getServiceURL, getStatus, getURL, parseURL, relativeTo, relativeTo, relativeTo, replaceHref, 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, registerNatives, wait, wait, wait
 

Constructor Detail

Form

public Form(Tag startTag,
            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 element
endTag - End tag of element
base - Base URL used for relative references
Method Detail

urlFromHref

protected java.net.URL urlFromHref(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

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(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.

makeQuery

private void makeQuery(Element elem,
                       java.lang.StringBuffer query)

passArgument

private void passArgument(java.lang.StringBuffer query,
                          java.lang.String name,
                          java.lang.String value)