Package org.javlo.component.form
Class Form
- java.lang.Object
-
- org.javlo.component.form.Form
-
- Direct Known Subclasses:
AddressFormRegister,FormMailing
public abstract class Form extends Object
- Author:
- pvandermaesen
-
-
Constructor Summary
Constructors Constructor Description Form()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()static FormgetCurrentSessionForm(javax.servlet.http.HttpSession session)StringgetErrorMessage(String fieldName)return the error message for a specific fieldabstract String[][]getFieldPattern()define a pattern for all field. the first col is field name, the second is the pattern.String[]getFields()return fields nameStringgetHelpMessage(String fieldName)return the help message for a specific fieldStringgetJSP()get the JSP for render the formGenericMessagegetMessage(String fieldName)static FormgetSpecialSessionForm(javax.servlet.http.HttpSession session, Object formKey)StringgetValue(String fieldName)booleanisSaved()booleanisValid()booleanisValid(boolean isLogged)validate the formvoidsetHelpMessage(String fieldName, String key)voidsetSaved(boolean saved)voidsetValue(String fieldName, String fieldValue)voidsetValues(Map map)voidsetValues(javax.servlet.http.HttpServletRequest request)
-
-
-
Field Detail
-
logger
protected static Logger logger
create a static logger.
-
-
Method Detail
-
getFieldPattern
public abstract String[][] getFieldPattern()
define a pattern for all field. the first col is field name, the second is the pattern.
-
getJSP
public String getJSP()
get the JSP for render the form- Returns:
-
isValid
public boolean isValid()
-
isValid
public boolean isValid(boolean isLogged)
validate the form- Returns:
- true if all fields is valid, false else.
-
getMessage
public GenericMessage getMessage(String fieldName)
-
getErrorMessage
public String getErrorMessage(String fieldName)
return the error message for a specific field- Parameters:
fieldName- the name of the field- Returns:
- a text represant a error message
-
getHelpMessage
public String getHelpMessage(String fieldName)
return the help message for a specific field- Parameters:
fieldName- the name of the field- Returns:
- a text represant a help message
-
getFields
public String[] getFields()
return fields name- Returns:
- a array of field name
-
getSpecialSessionForm
public static Form getSpecialSessionForm(javax.servlet.http.HttpSession session, Object formKey)
-
getCurrentSessionForm
public static Form getCurrentSessionForm(javax.servlet.http.HttpSession session)
-
setValues
public void setValues(Map map)
-
setValues
public void setValues(javax.servlet.http.HttpServletRequest request)
-
clear
public void clear()
-
isSaved
public boolean isSaved()
-
setSaved
public void setSaved(boolean saved)
-
-