info.bliki.htmlcleaner.util
Class HtmlForm

java.lang.Object
  extended by info.bliki.htmlcleaner.util.HtmlForm

public class HtmlForm
extends java.lang.Object

Represents form data parsed from HTML. Sources adopted from the article Add Java extensions to your wiki with permission from Randall Scarberry.

Author:
R.Scarberry

Nested Class Summary
static class HtmlForm.Element
          Class to encapsulate the data found in HTML form elements.
static class HtmlForm.ElementAttribute
          Class representing an HTML form element attribute.
 
Field Summary
static int GET
           
static int POST
           
 
Constructor Summary
HtmlForm(java.lang.String id, int method, java.lang.String action, java.lang.String encType)
          Constructor for which everything is specified but the name.
HtmlForm(java.lang.String id, java.lang.String name, int method, java.lang.String action, java.lang.String encType)
          Constructor.
 
Method Summary
 void addElement(HtmlForm.Element element)
           
 java.lang.String getAction()
           
 HtmlForm.Element getElement(int i)
           
 int getElementCount()
           
 java.lang.String getEncType()
           
 java.lang.String getID()
           
 int getMethod()
           
 java.lang.String getName()
           
 void setAction(java.lang.String action)
           
 void setEncType(java.lang.String encType)
           
 void setID(java.lang.String mid)
           
 void setMethod(int method)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET

public static final int GET
See Also:
Constant Field Values

POST

public static final int POST
See Also:
Constant Field Values
Constructor Detail

HtmlForm

public HtmlForm(java.lang.String id,
                java.lang.String name,
                int method,
                java.lang.String action,
                java.lang.String encType)
Constructor.

Parameters:
id - element id, which is usually the same as the name when both are supplied.
name - the name, which is usually the same as id, when both are supplied.
method - the method, POST or GET.
action - the form action.
encType - form encoding.

HtmlForm

public HtmlForm(java.lang.String id,
                int method,
                java.lang.String action,
                java.lang.String encType)
Constructor for which everything is specified but the name. The name defaults to the empty string.

Parameters:
id - element id.
method - the method, POST or GET.
action - the form action.
encType - form encoding.
Method Detail

addElement

public void addElement(HtmlForm.Element element)

getElementCount

public int getElementCount()

getElement

public HtmlForm.Element getElement(int i)

getID

public java.lang.String getID()

getName

public java.lang.String getName()

getMethod

public int getMethod()

getAction

public java.lang.String getAction()

getEncType

public java.lang.String getEncType()

setID

public void setID(java.lang.String mid)

setName

public void setName(java.lang.String name)

setMethod

public void setMethod(int method)

setAction

public void setAction(java.lang.String action)

setEncType

public void setEncType(java.lang.String encType)


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.