Class FormTag
java.lang.Object
org.htmlparser.nodes.AbstractNode
org.htmlparser.nodes.TagNode
org.htmlparser.tags.CompositeTag
org.htmlparser.tags.FormTag
- All Implemented Interfaces:
Serializable, Cloneable, Node, Tag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe "GET" method.protected StringThis is the derived form location, based on action.static final StringThe "POST" method.Fields inherited from class CompositeTag
mDefaultCompositeScanner, mEndTagFields inherited from class TagNode
breakTags, mAttributes, mDefaultScanner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtract theACTIONattribute as an absolute URL.String[]Return the set of tag names that cause this tag to finish.String[]Return the set of end tag names that cause this tag to finish.Get the list of input fields.Get the value of the action attribute.Returns the method of the form, GET or POST.Get the value of the name attribute.Get the list of text areas.String[]getIds()Return the set of names handled by this tag.getInputTag(String name) Get the input tag in the form corresponding to the given namegetTextAreaTag(String name) Find the textarea tag matching the given namevoidsetFormLocation(String url) Set the form location.toString()Return a string representation of the contents of thisFORMtag suitable for debugging.Methods inherited from class 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, toStringMethods inherited from class 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, setThisScannerMethods inherited from class AbstractNode
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtmlMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Node
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
-
Field Details
-
POST
-
GET
-
mFormLocation
This is the derived form location, based on action.
-
-
Constructor Details
-
FormTag
public FormTag()Create a new form tag.
-
-
Method Details
-
getIds
-
getEnders
-
getEndTagEnders
Return the set of end tag names that cause this tag to finish.- Specified by:
getEndTagEndersin interfaceTag- Overrides:
getEndTagEndersin classTagNode- Returns:
- The names of following end tags that stop further scanning.
-
getFormInputs
-
getFormTextareas
Get the list of text areas.- Returns:
- Textarea elements in the form.
-
getFormLocation
Get the value of the action attribute.- Returns:
- The submit url of the form.
-
setFormLocation
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
Returns the method of the form, GET or POST.- Returns:
- String The method of the form (GET if nothing is specified).
-
getInputTag
-
getFormName
Get the value of the name attribute.- Returns:
- String The name of the form
-
getTextAreaTag
Find the textarea tag matching the given name- Parameters:
name- Name of the textarea tag to be found within the form.- Returns:
- The
TEXTAREAtag with the matching name.
-
toString
Return a string representation of the contents of thisFORMtag suitable for debugging.- Specified by:
toStringin interfaceNode- Overrides:
toStringin classCompositeTag- Returns:
- A textual representation of the form tag.
-
extractFormLocn
Extract theACTIONattribute as an absolute URL.- Returns:
- The URL the form is to be submitted to.
-