Package org.appng.formtags
Class Form
- java.lang.Object
-
- org.appng.formtags.Form
-
public class Form extends Object
This class represents a HTML form. AForm
consists of two parts:- the
FormData
, wrapping the variousFormElement
s - the
FormConfirmation
, responsible for what happens after the form has been submitted.
FormProcessProvider
s which are processing the form inputs.- Author:
- Matthias Müller
- See Also:
FormData
,FormElement
,FormConfirmation
,FormProcessProvider
- the
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addFormProcessProvider(FormProcessProvider formProcessProvider)
Adds aFormProcessProvider
to thisForm
.void
enableLogging()
FormConfirmation
getFormConfirmation()
Returns theFormConfirmation
for thisForm
.FormData
getFormData()
Request
getRequest()
Boolean
getRestoreRequestData()
RuleValidation
getRuleValidation()
Returns theRuleValidation
for thisForm
.boolean
hasErrors()
Convenient method for checking whethers thisForm
has validation errors, delegating toFormElementOwner.hasErrors()
.boolean
isSubmitted()
Checks whether thisForm
has been submitted.boolean
removeFormProcessProvider(FormProcessProvider formProcessProvider)
Removes aFormProcessProvider
to thisForm
.void
runProcessProviders(Writer writer, Map<String,Object> properties)
Executes theFormProcessProvider
previously added by callingaddFormProcessProvider(FormProcessProvider)
.void
setFormConfirmation(FormConfirmation formConfirmation)
Sets theFormConfirmation
for thisForm
.void
setFormData(FormData formData)
void
setRequest(Request request)
Sets theRequest
for this form.void
setRestoreRequestData(Boolean restoreRequestData)
void
setSubmitted(boolean submitted)
Sets whether or not thisForm
has been submitted.
-
-
-
Constructor Detail
-
Form
public Form()
Constructs a newForm
-
-
Method Detail
-
enableLogging
public void enableLogging()
-
addFormProcessProvider
public boolean addFormProcessProvider(FormProcessProvider formProcessProvider)
Adds aFormProcessProvider
to thisForm
.- Parameters:
formProcessProvider
- theFormProcessProvider
to add- Returns:
true
if adding was successful,false
otherwise
-
removeFormProcessProvider
public boolean removeFormProcessProvider(FormProcessProvider formProcessProvider)
Removes aFormProcessProvider
to thisForm
.- Parameters:
formProcessProvider
- theFormProcessProvider
to remove- Returns:
true
if removing was successful,false
otherwise
-
isSubmitted
public boolean isSubmitted()
Checks whether thisForm
has been submitted.- Returns:
true
if thisForm
has been submitted,false
otherwise
-
setSubmitted
public void setSubmitted(boolean submitted)
Sets whether or not thisForm
has been submitted.- Parameters:
submitted
-
-
hasErrors
public boolean hasErrors()
Convenient method for checking whethers thisForm
has validation errors, delegating toFormElementOwner.hasErrors()
.- Returns:
true
if thisForm
has validation errors,false
otherwise
-
setRequest
public void setRequest(Request request)
Sets theRequest
for this form.- Parameters:
request
- theRequest
-
getRuleValidation
public RuleValidation getRuleValidation()
Returns theRuleValidation
for thisForm
.- Returns:
- the
RuleValidation
-
getRestoreRequestData
public Boolean getRestoreRequestData()
-
setRestoreRequestData
public void setRestoreRequestData(Boolean restoreRequestData)
-
getFormConfirmation
public FormConfirmation getFormConfirmation()
Returns theFormConfirmation
for thisForm
.- Returns:
- the
FormConfirmation
-
setFormConfirmation
public void setFormConfirmation(FormConfirmation formConfirmation)
Sets theFormConfirmation
for thisForm
.- Parameters:
formConfirmation
- theFormConfirmation
-
runProcessProviders
public void runProcessProviders(Writer writer, Map<String,Object> properties)
Executes theFormProcessProvider
previously added by callingaddFormProcessProvider(FormProcessProvider)
. Thus means,FormProcessProvider.onFormSuccess(Writer, Form, Map)
is being executed with the givenWriter
and the given propertyMap
.- Parameters:
writer
- aWriter
properties
- the propertyMap
- See Also:
FormProcessProvider.onFormSuccess(Writer, Form, Map)
-
-