Package org.htmlparser.tags
Class FormTag
- java.lang.Object
-
- org.htmlparser.nodes.AbstractNode
-
- org.htmlparser.nodes.TagNode
-
- org.htmlparser.tags.CompositeTag
-
- org.htmlparser.tags.FormTag
-
public class FormTag extends CompositeTag
Represents a FORM tag.- Author:
- ili
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GET
The "GET" method.protected java.lang.String
mFormLocation
This is the derived form location, based on action.static java.lang.String
POST
The "POST" method.-
Fields inherited from class org.htmlparser.tags.CompositeTag
mDefaultCompositeScanner, mEndTag
-
Fields inherited from class org.htmlparser.nodes.TagNode
breakTags, mAttributes, mDefaultScanner
-
-
Constructor Summary
Constructors Constructor Description FormTag()
Create a new form tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
extractFormLocn()
Extract theACTION
attribute as an absolute URL.java.lang.String[]
getEnders()
Return the set of tag names that cause this tag to finish.java.lang.String[]
getEndTagEnders()
Return the set of end tag names that cause this tag to finish.NodeList
getFormInputs()
Get the list of input fields.java.lang.String
getFormLocation()
Get the value of the action attribute.java.lang.String
getFormMethod()
Returns the method of the form, GET or POST.java.lang.String
getFormName()
Get the value of the name attribute.NodeList
getFormTextareas()
Get the list of text areas.java.lang.String[]
getIds()
Return the set of names handled by this tag.InputTag
getInputTag(java.lang.String name)
Get the input tag in the form corresponding to the given nameTextareaTag
getTextAreaTag(java.lang.String name)
Find the textarea tag matching the given namevoid
setFormLocation(java.lang.String url)
Set the form location.java.lang.String
toString()
Return a string representation of the contents of thisFORM
tag suitable for debugging.-
Methods inherited from class org.htmlparser.tags.CompositeTag
accept, childAt, children, collectInto, digupStringNode, elements, findPositionOf, findPositionOf, findPositionOf, getChild, getChildCount, getChildrenAsNodeArray, getChildrenHTML, getEndTag, getStringText, getText, putChildrenInto, putEndTagInto, removeChild, searchByName, searchFor, searchFor, searchFor, searchFor, setEndTag, toHtml, toPlainTextString, toString
-
Methods inherited from class org.htmlparser.nodes.TagNode
breaksFlow, getAttribute, getAttributeEx, getAttributesEx, getEndingLineNumber, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, getThisScanner, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributeEx, setAttributesEx, setEmptyXmlTag, setTagBegin, setTagEnd, setTagName, setText, setThisScanner
-
Methods inherited from class org.htmlparser.nodes.AbstractNode
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.htmlparser.Node
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
-
-
-
-
Field Detail
-
POST
public static final java.lang.String POST
The "POST" method.- See Also:
getFormMethod()
, Constant Field Values
-
GET
public static final java.lang.String GET
The "GET" method.- See Also:
getFormMethod()
, Constant Field Values
-
mFormLocation
protected java.lang.String mFormLocation
This is the derived form location, based on action.
-
-
Method Detail
-
getIds
public java.lang.String[] getIds()
Return the set of names handled by this tag.
-
getEnders
public java.lang.String[] getEnders()
Return the set of tag names that cause this tag to finish.
-
getEndTagEnders
public java.lang.String[] getEndTagEnders()
Return the set of end tag names that cause this tag to finish.- Specified by:
getEndTagEnders
in interfaceTag
- Overrides:
getEndTagEnders
in classTagNode
- 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.
-
getFormTextareas
public NodeList getFormTextareas()
Get the list of text areas.- Returns:
- Textarea elements in the form.
-
getFormLocation
public java.lang.String getFormLocation()
Get the value of the action attribute.- Returns:
- The submit url of the form.
-
setFormLocation
public void setFormLocation(java.lang.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
-
getFormMethod
public java.lang.String getFormMethod()
Returns the method of the form, GET or POST.- Returns:
- String The method of the form (GET if nothing is specified).
-
getInputTag
public InputTag getInputTag(java.lang.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
-
getFormName
public java.lang.String getFormName()
Get the value of the name attribute.- Returns:
- String The name of the form
-
getTextAreaTag
public TextareaTag getTextAreaTag(java.lang.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.
-
toString
public java.lang.String toString()
Return a string representation of the contents of thisFORM
tag suitable for debugging.- Specified by:
toString
in interfaceNode
- Overrides:
toString
in classCompositeTag
- Returns:
- A textual representation of the form tag.
-
extractFormLocn
public java.lang.String extractFormLocn()
Extract theACTION
attribute as an absolute URL.- Returns:
- The URL the form is to be submitted to.
-
-