Agent System POND 1.2 (28.2.2002)

FIM.Util.WWW.Form
Class ActionElement

java.lang.Object
  |
  +--FIM.Util.WWW.Form.FormElement
        |
        +--FIM.Util.WWW.Form.ActionElement
All Implemented Interfaces:
Element, Serializable
Direct Known Subclasses:
ButtonElement, InputResetElement, InputSubmitElement

public abstract class ActionElement
extends FormElement

An element of a HTML-form which produced an action if invoked (e. g. resetting the form or submitting it).

Version:
1.0, 1.7.2000
Author:
Michael Sonntag
See Also:
Serialized Form

Fields inherited from class FIM.Util.WWW.Form.FormElement
attributes, children
 
Constructor Summary
ActionElement(HTMLDocument doc, Element parent, int startOffs, int endOffs, String name, String value)
          Creates a new action element.
 
Method Summary
abstract  void doAction()
          Placeholder for the action to do when the element is invoked.
 String getEncoded()
          Returns this element in encoded (application/x-www-form-urlencoded) form.
 String getValue()
          Retrieve the value of the element.
 int match(String[] matchStr)
          Matches this element against a number of strings and returns a measure for matching them. 0=no match, 100=perfect match.
Extension to FormElement: Value match=80 exact, 70 substring
 void reset()
          Resets the element to its initial state.
 String toString()
          Returns a string representation of the action element.
 
Methods inherited from class FIM.Util.WWW.Form.FormElement
getAttributes, getDocument, getElement, getElementCount, getElementIndex, getEndOffset, getLabel, getName, getParentElement, getStartOffset, isLeaf, setLabel
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionElement

public ActionElement(HTMLDocument doc,
                     Element parent,
                     int startOffs,
                     int endOffs,
                     String name,
                     String value)
Creates a new action element.
Parameters:
doc - the document this element belongs to
parent - the parent of this element
startOffs - start offset of the element in the document
endOffs - end offset of the element in the document
name - the name of the element
value - the value of the element or null if none exists
Method Detail

reset

public void reset()
Resets the element to its initial state. Empty implementation, as action elements usually have no state.
Overrides:
reset in class FormElement

doAction

public abstract void doAction()
Placeholder for the action to do when the element is invoked. Subclasses must provide implementations.

getEncoded

public String getEncoded()
Returns this element in encoded (application/x-www-form-urlencoded) form. If the value is null, only the name is submitted.
Overrides:
getEncoded in class FormElement
Returns:
the element in encoded form

getValue

public String getValue()
Retrieve the value of the element.
Returns:
the value of the element

match

public int match(String[] matchStr)
Matches this element against a number of strings and returns a measure for matching them. 0=no match, 100=perfect match.
Extension to FormElement: Value match=80 exact, 70 substring
Overrides:
match in class FormElement
Parameters:
matchStr - an array of strings which are matched against this element
Returns:
measure how much this element matches the parameter

toString

public String toString()
Returns a string representation of the action element.
Overrides:
toString in class FormElement
Returns:
string representation of the form element

Agent System POND 1.2 (28.2.2002)

Submit a bug

Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.