org.apache.wiki.forms
Class FormInfo

java.lang.Object
  extended by org.apache.wiki.forms.FormInfo
All Implemented Interfaces:
Serializable

public class FormInfo
extends Object
implements Serializable

Container for carrying HTTP FORM information between WikiPlugin invocations in the Session.

See Also:
Serialized Form

Field Summary
static int ERROR
          State: There was an error.
static int EXECUTED
          State: Form is executed.
static int OK
          State: Form is OK.
 
Constructor Summary
FormInfo()
          Creates a new FormInfo with status == OK.
 
Method Summary
 void addSubmission(Map<String,String> val)
          Adds the given values into the handler parameter map.
 String getAction()
          Get the action set in setAction(String).
 String getError()
          Return the error.
 String getHandler()
          Return the name of the handler class.
 String getName()
          Return the name of the form.
 String getResult()
          Return the result.
 int getStatus()
          Return the status.
 Map<String,String> getSubmission()
          Returns parameter name-value pairs for a Form handler WikiPlugin.
 boolean hide()
          Returns true, if the form is supposed to be hidden.
 void setAction(String val)
          Set the value of the action parameter.
 void setError(String val)
          Set an error string.
 void setHandler(String val)
          Set the name of the handler class.
 void setHide(boolean val)
          Set the hide parameter.
 void setName(String val)
          Sets the name of the form.
 void setResult(String val)
          Set the result.
 void setStatus(int val)
          Set the status of the Form processing.
 void setSubmission(Map<String,String> val)
          Copies the given values into the handler parameter map using Map.putAll().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXECUTED

public static final int EXECUTED
State: Form is executed.

See Also:
Constant Field Values

OK

public static final int OK
State: Form is OK.

See Also:
Constant Field Values

ERROR

public static final int ERROR
State: There was an error.

See Also:
Constant Field Values
Constructor Detail

FormInfo

public FormInfo()
Creates a new FormInfo with status == OK.

Method Detail

setStatus

public void setStatus(int val)
Set the status of the Form processing.

Parameters:
val - EXECUTED, OK or ERROR.

getStatus

public int getStatus()
Return the status.

Returns:
The status.

setHide

public void setHide(boolean val)
Set the hide parameter.

Parameters:
val - True or false.

hide

public boolean hide()
Returns true, if the form is supposed to be hidden.

Returns:
True or false.

setAction

public void setAction(String val)
Set the value of the action parameter.

Parameters:
val - A value parameter.

getAction

public String getAction()
Get the action set in setAction(String).

Returns:
An Action.

setName

public void setName(String val)
Sets the name of the form.

Parameters:
val - The name of the form.

getName

public String getName()
Return the name of the form.

Returns:
The name of the form.

setHandler

public void setHandler(String val)
Set the name of the handler class.

Parameters:
val - The name of the class.

getHandler

public String getHandler()
Return the name of the handler class.

Returns:
The name of the class.

setResult

public void setResult(String val)
Set the result.

Parameters:
val - The result.

getResult

public String getResult()
Return the result.

Returns:
The result.

setError

public void setError(String val)
Set an error string.

Parameters:
val - An error string.

getError

public String getError()
Return the error.

Returns:
The error.

setSubmission

public void setSubmission(Map<String,String> val)
Copies the given values into the handler parameter map using Map.putAll().

Parameters:
val - parameter name-value pairs for a Form handler WikiPlugin

addSubmission

public void addSubmission(Map<String,String> val)
Adds the given values into the handler parameter map.

Parameters:
val - parameter name-value pairs for a Form handler WikiPlugin

getSubmission

public Map<String,String> getSubmission()
Returns parameter name-value pairs for a Form handler WikiPlugin. The names are those of Form input fields, and the values whatever the user selected in the form. The FormSet plugin can also be used to provide initial values.

Returns:
Handler parameter name-value pairs.


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.