|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.devsphere.mapping.FormUtils
Utility class that implements form related operations.
CharacterEncoding,
FormData,
FormDocument,
FormTemplate,
AbstractLogger| Method Summary | |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
AbstractLogger logger)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.util.Locale locale)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.lang.String prefix)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static void |
beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.lang.String prefix,
java.util.Locale locale)
Inserts the values of the properties of a bean within a form document as the default values of the form elements. |
static java.util.Hashtable |
formToBean(FormData formData,
java.lang.Object bean)
Fills the properties of a bean with the values of the parameters of an HTTP request. |
static java.util.Hashtable |
formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger)
Fills the properties of a bean with the values of the parameters of an HTTP request. |
static java.util.Hashtable |
formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.util.Locale locale)
Fills the properties of a bean with the values of the parameters of an HTTP request. |
static java.util.Hashtable |
formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.lang.String prefix)
Fills the properties of a bean with the values of the parameters of an HTTP request. |
static java.util.Hashtable |
formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.lang.String prefix,
java.util.Locale locale)
Fills the properties of a bean with the values of the parameters of an HTTP request. |
static FormTemplate |
getTemplate(java.io.File file)
Loads the content of an HTML file, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.File file,
boolean useCache)
Loads the content of an HTML file, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.File file,
int encoding)
Loads the content of an HTML file, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.File file,
int encoding,
boolean useCache)
Loads the content of an HTML file, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.InputStream input)
Loads the content of an input stream, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.InputStream input,
int encoding)
Loads the content of an input stream, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.io.Reader reader)
Loads the content of a reader, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.lang.String content)
Parses the given HTML content and creates a form template. |
static FormTemplate |
getTemplate(java.net.URL url)
Loads the content of a URL, parses it and creates a form template. |
static FormTemplate |
getTemplate(java.net.URL url,
int encoding)
Loads the content of a URL, parses it and creates a form template. |
static java.lang.String |
messageToHTML(java.lang.String message)
Processes the parameter so that the returned string can be inserted in an HTML document as text. |
static void |
removeAllTemplatesFromCache()
Removes all templates from the cache. |
static FormTemplate |
removeTemplateFromCache(java.io.File file)
Removes a template from the cache. |
static java.lang.String |
valueToHTML(java.lang.String value)
Processes the parameter so that the returned string can be inserted in an HTML document as an attribute's value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static FormTemplate getTemplate(java.lang.String content)
content - the HTML content that will be parsed
in order to build the form template.NullPointerException - if content is null.
public static FormTemplate getTemplate(java.io.InputStream input)
throws java.io.IOException
input - the input stream whose HTML content will be parsed
in order to build the form template.NullPointerException - if input is null.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.InputStream input,
int encoding)
throws java.io.IOException
input - the input stream whose HTML content will be parsed
in order to build the form template.encoding - the character encoding. See the constants declared by CharacterEncoding.NullPointerException - if input is null.java.lang.IllegalArgumentException - if encoding has an invalid value.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.Reader reader)
throws java.io.IOException
reader - the reader whose HTML content will be parsed
in order to build the form template.NullPointerException - if reader is null.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.net.URL url)
throws java.io.IOException
url - the URL of the HTML document that will be parsed
in order to build the form template.NullPointerException - if url is null.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.net.URL url,
int encoding)
throws java.io.IOException
url - the URL of the HTML document that will be parsed
in order to build the form template.encoding - the character encoding. See the constants declared by CharacterEncoding.NullPointerException - if url is null.java.lang.IllegalArgumentException - if encoding has an invalid value.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.File file)
throws java.io.IOException
file - the HTML document that will be parsed
in order to build the form template.NullPointerException - if file is null.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.File file,
int encoding)
throws java.io.IOException
file - the HTML document that will be parsed
in order to build the form template.encoding - the character encoding. See the constants declared by CharacterEncoding.NullPointerException - if file is null.java.lang.IllegalArgumentException - if encoding has an invalid value.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.File file,
boolean useCache)
throws java.io.IOException
useCache is true.file - the HTML document that will be parsed
in order to build the form template.useCache - flag that enables or disables the caching mechanism
of the templates that are created from files.NullPointerException - if file is null.java.io.IOException - if an I/O error occurs.
public static FormTemplate getTemplate(java.io.File file,
int encoding,
boolean useCache)
throws java.io.IOException
useCache is true.file - the HTML document that will be parsed
in order to build the form template.encoding - the character encoding. See the constants declared by CharacterEncoding.useCache - flag that enables or disables the caching mechanism
of the templates that are created from files.NullPointerException - if file is null.java.lang.IllegalArgumentException - if encoding has an invalid value.java.io.IOException - if an I/O error occurs.public static FormTemplate removeTemplateFromCache(java.io.File file)
file - the HTML document that was parsed
in order to build the form template.NullPointerException - if file is null.public static void removeAllTemplatesFromCache()
public static java.util.Hashtable formToBean(FormData formData,
java.lang.Object bean)
formData - the objects that contains the form data.bean - the bean instance whose properties must be filled with form data.null if no error occurred.NullPointerException - if formData is null or bean is null.
public static java.util.Hashtable formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger)
formData - the objects that contains the form data.bean - the bean instance whose properties must be filled with form data.logger - logging mechanism for application errors.null if no error occurred.NullPointerException - if formData is null or bean is null.
public static java.util.Hashtable formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.lang.String prefix)
formData - the objects that contains the form data.bean - the bean instance whose properties must be filled with form data.logger - logging mechanism for application errors.prefix - the prefix of the names of the form parameters.null if no error occurred.NullPointerException - if formData is null or bean is null.
public static java.util.Hashtable formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.util.Locale locale)
formData - the objects that contains the form data.bean - the bean instance whose properties must be filled with form data.logger - logging mechanism for application errors.locale - internationalization support parameter.null if no error occurred.NullPointerException - if formData is null or bean is null.
public static java.util.Hashtable formToBean(FormData formData,
java.lang.Object bean,
AbstractLogger logger,
java.lang.String prefix,
java.util.Locale locale)
formData - the objects that contains the form data.bean - the bean instance whose properties must be filled with form data.logger - logging mechanism for application errors.prefix - the prefix of the names of the form parameters.locale - internationalization support parameter.null if no error occurred.NullPointerException - if formData is null or bean is null.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.formName - the optional name of the form, which should be used if the document contains multiple forms.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
AbstractLogger logger)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.logger - logging mechanism for application errors.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.formName - the optional name of the form, which should be used if the document contains multiple forms.logger - logging mechanism for application errors.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.lang.String prefix)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.formName - the optional name of the form, which should be used if the document contains multiple forms.logger - logging mechanism for application errors.prefix - the prefix of the names of the form parameters.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.util.Locale locale)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.formName - the optional name of the form, which should be used if the document contains multiple forms.logger - logging mechanism for application errors.locale - internationalization support parameter.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.
public static void beanToForm(java.lang.Object bean,
java.util.Hashtable errorTable,
FormDocument document,
java.lang.String formName,
AbstractLogger logger,
java.lang.String prefix,
java.util.Locale locale)
errorTable
parameter may be null or it must be a hashtable returned by one of
the mapping methods of the framework. In the latter case, the error
messages are inserted within the form document too.bean - the bean instance whose properties must be inserted within the form document.errorTable - hashtable containing mapping errors.document - object created by getDocument() of FormTemplate.formName - the optional name of the form, which should be used if the document contains multiple forms.logger - logging mechanism for application errors.prefix - the prefix of the names of the form parameters.locale - internationalization support parameter.NullPointerException - if bean is null or document is null.java.lang.IllegalArgumentException - if errorTable wasn't created by this framework
or document wasn't created by this framework
or the HTML form isn't found within the document.public static java.lang.String messageToHTML(java.lang.String message)
message - the text that has to be inserted within the HTML document.NullPointerException - if message is null.public static java.lang.String valueToHTML(java.lang.String value)
value - the text that has to be inserted within the HTML document.NullPointerException - if value is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||