org.htmlparser.tags

Class FormTag

public class FormTag extends CompositeTag

Represents a FORM tag.

Author: ili

Field Summary
static StringGET
The {@value } method.
protected StringmFormLocation
This is the derived form location, based on action.
static StringPOST
The {@value } method.
Constructor Summary
FormTag()
Create a new form tag.
Method Summary
StringextractFormLocn()
Extract the ACTION attribute as an absolute URL.
String[]getEnders()
Return the set of tag names that cause this tag to finish.
String[]getEndTagEnders()
Return the set of end tag names that cause this tag to finish.
NodeListgetFormInputs()
Get the list of input fields.
StringgetFormLocation()
Get the value of the action attribute.
StringgetFormMethod()
Returns the method of the form, GET or POST.
StringgetFormName()
Get the value of the name attribute.
NodeListgetFormTextareas()
Get the list of text areas.
String[]getIds()
Return the set of names handled by this tag.
InputTaggetInputTag(String name)
Get the input tag in the form corresponding to the given name
TextareaTaggetTextAreaTag(String name)
Find the textarea tag matching the given name
voidsetFormLocation(String url)
Set the form location.
StringtoString()
Return a string representation of the contents of this FORM tag suitable for debugging.

Field Detail

GET

public static final String GET
The {@value } method.

See Also: FormTag

mFormLocation

protected String mFormLocation
This is the derived form location, based on action.

POST

public static final String POST
The {@value } method.

See Also: FormTag

Constructor Detail

FormTag

public FormTag()
Create a new form tag.

Method Detail

extractFormLocn

public String extractFormLocn()
Extract the ACTION attribute as an absolute URL.

Returns: The URL the form is to be submitted to.

getEnders

public String[] getEnders()
Return the set of tag names that cause this tag to finish.

Returns: The names of following tags that stop further scanning.

getEndTagEnders

public String[] getEndTagEnders()
Return the set of end tag names that cause this tag to finish.

Returns: The names of following end tags that stop further scanning.

getFormInputs

public NodeList getFormInputs()
Get the list of input fields.

Returns: Input elements in the form.

getFormLocation

public String getFormLocation()
Get the value of the action attribute.

Returns: The submit url of the form.

getFormMethod

public String getFormMethod()
Returns the method of the form, GET or POST.

Returns: String The method of the form (GET if nothing is specified).

getFormName

public String getFormName()
Get the value of the name attribute.

Returns: String The name of the form

getFormTextareas

public NodeList getFormTextareas()
Get the list of text areas.

Returns: Textarea elements in the form.

getIds

public String[] getIds()
Return the set of names handled by this tag.

Returns: The names to be matched that create tags of this type.

getInputTag

public InputTag getInputTag(String name)
Get the input tag in the form corresponding to the given name

Parameters: name The name of the input tag to be retrieved

Returns: Tag The input tag corresponding to the name provided

getTextAreaTag

public TextareaTag getTextAreaTag(String name)
Find the textarea tag matching the given name

Parameters: name Name of the textarea tag to be found within the form.

Returns: The TEXTAREA tag with the matching name.

setFormLocation

public void setFormLocation(String url)
Set the form location. Modification of this element will cause the HTML rendering to change as well (in a call to toHTML()).

Parameters: url The new FORM location

toString

public String toString()
Return a string representation of the contents of this FORM tag suitable for debugging.

Returns: A textual representation of the form tag.

HTML Parser is an open source library released under LGPL. SourceForge.net