|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.site.FormBuilderXml
public class FormBuilderXml
| Field Summary |
|---|
| Fields inherited from interface com.uwyn.rife.site.FormBuilder |
|---|
ID_FORM_FIELD, ID_FORM_LABEL, ID_FORM_NAME, ID_FORM_VALUE, MIDDLE_ATTRIBUTES, PREFIX_FORM_CHECKBOX, PREFIX_FORM_DISPLAY, PREFIX_FORM_HIDDEN, PREFIX_FORM_INPUT, PREFIX_FORM_LABEL, PREFIX_FORM_RADIO, PREFIX_FORM_SECRET, PREFIX_FORM_SELECT, PREFIX_FORM_TEXTAREA, SUFFIX_CHECKED, SUFFIX_SELECTED, VALUE_PREFIXES |
| Constructor Summary | |
|---|---|
FormBuilderXml()
|
|
| Method Summary | |
|---|---|
Object |
clone()
|
Collection<String> |
generateField(Template template,
Class propertyType,
ConstrainedProperty property,
String[] values,
String prefix)
Generates a form field for one particular property. |
Collection<String> |
generateField(Template template,
Class propertyType,
String name,
String[] values,
String prefix)
Generates a form field for one particular property name. |
Collection<String> |
generateField(Template template,
ConstrainedProperty property,
String[] values,
String prefix)
Generates a form field for one particular property. |
Collection<String> |
generateField(Template template,
String name,
String[] values,
String prefix)
Generates a form field for one particular property name. |
Collection<String> |
generateForm(Template template,
Class beanClass,
Map<String,String[]> values,
String prefix)
Generates all the form fields for a bean class. |
Collection<String> |
generateForm(Template template,
Object bean,
Map<String,String[]> values,
String prefix)
Generates all the form fields for a bean instance. |
ValidationBuilder |
getValidationBuilder()
Returns the ValidationBuilder that is used by this
FormBuilder. |
void |
removeField(Template template,
String templateFieldName)
Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.replaceField(com.uwyn.rife.template.Template, java.lang.String, com.uwyn.rife.site.ConstrainedProperty, java.lang.String[], java.lang.String)
method. |
void |
removeField(Template template,
String name,
String prefix)
Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.generateField(com.uwyn.rife.template.Template, com.uwyn.rife.site.ConstrainedProperty, java.lang.String[], java.lang.String)
method. |
void |
removeForm(Template template,
Class beanClass,
String prefix)
Removes the content of all the template values that would otherwise be filled in with generated form fields through the FormBuilder.generateForm(Template, Class, Map, String)
method. |
Collection<String> |
replaceField(Template template,
String templateFieldName,
Class propertyType,
ConstrainedProperty property,
String[] values,
String prefix)
Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format. |
Collection<String> |
replaceField(Template template,
String templateFieldName,
Class propertyType,
String name,
String[] values,
String prefix)
Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format. |
Collection<String> |
replaceField(Template template,
String templateFieldName,
ConstrainedProperty property,
String[] values,
String prefix)
Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format. |
Collection<String> |
replaceField(Template template,
String templateFieldName,
String name,
String[] values,
String prefix)
Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format. |
Collection<String> |
selectParameter(Template template,
String name,
String[] values)
Generates the required attributes so that an existing form field indicates its checked or selected status. |
void |
unselectParameter(Template template,
String name,
String[] values)
Removes the generated attributes that indicate that an existing form field is checked or selected |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormBuilderXml()
| Method Detail |
|---|
public Collection<String> generateForm(Template template,
Class beanClass,
Map<String,String[]> values,
String prefix)
throws BeanUtilsException
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateForm in interface FormBuildertemplate - the template instance that will be used for the form
generationbeanClass - the bean class whose properties will be analyzed for
the form generationvalues - a map of name-value pairs that indicate the currently
active context for the form that will be generated, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form fields with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
BeanUtilsException - when errors occurred during the form
generation
public Collection<String> generateForm(Template template,
Object bean,
Map<String,String[]> values,
String prefix)
throws BeanUtilsException
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateForm in interface FormBuildertemplate - the template instance that will be used for the form
generationbean - the bean instance whose properties and validation errors
will be analyzed for the form generationvalues - a map of name-value pairs that indicate the currently
active context for the form that will be generated, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form fields with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
BeanUtilsException - when errors occurred during the form
generation
public Collection<String> generateField(Template template,
ConstrainedProperty property,
String[] values,
String prefix)
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateField in interface FormBuildertemplate - the template instance that will be used for the form
generationproperty - the constrained property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> generateField(Template template,
Class propertyType,
ConstrainedProperty property,
String[] values,
String prefix)
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateField in interface FormBuildertemplate - the template instance that will be used for the form
generationpropertyType - the type of the propertyproperty - the constrained property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> replaceField(Template template,
String templateFieldName,
ConstrainedProperty property,
String[] values,
String prefix)
FormBuilderThis method also adds a templateFieldName parameter.
It allows you to use another property name for the template values
than the one of the actual bean property. You will typically use this
when you dynamically generate a form and iterate over the generation
of certain fields. So, for example, when you have properties named
answer1 and answer2, you can use this
template snippet:
<!--V 'answers'/--> <!--B 'answer'--> <!--V 'FORM:INPUT:answer'/--> <!--/B-->By using the
replaceField(template, "answer", property, null, null)
method call for each answer property and appending the
answer block to the answers value, you can
benefit from the automatic form field generation but still dynamically
aggregate the results into one area.
replaceField in interface FormBuildertemplate - the template instance that will be used for the form
generationtemplateFieldName - the name of the form field that will be used to
look for supported value tags in the property templateproperty - the constrained property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> replaceField(Template template,
String templateFieldName,
Class propertyType,
ConstrainedProperty property,
String[] values,
String prefix)
FormBuilderThe documentation of the
previous replaceField method
contains more information about the functionality of this method.
replaceField in interface FormBuildertemplate - the template instance that will be used for the form
generationtemplateFieldName - the name of the form field that will be used to
look for supported value tags in the property templatepropertyType - the type of the propertyproperty - the constrained property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> generateField(Template template,
String name,
String[] values,
String prefix)
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateField in interface FormBuildertemplate - the template instance that will be used for the form
generationname - the name of the property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> generateField(Template template,
Class propertyType,
String name,
String[] values,
String prefix)
FormBuilderIf content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
generateField in interface FormBuildertemplate - the template instance that will be used for the form
generationpropertyType - the type of the propertyname - the name of the property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
public Collection<String> replaceField(Template template,
String templateFieldName,
String name,
String[] values,
String prefix)
FormBuilderThe documentation of the
previous replaceField method
contains more information about the functionality of this method.
replaceField in interface FormBuildertemplate - the template instance that will be used for the form
generationtemplateFieldName - the name of the form field that will be used to
look for supported value tags in the property templatename - the name of the property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
FormBuilder.replaceField(Template, String, ConstrainedProperty, String[], String)
public Collection<String> replaceField(Template template,
String templateFieldName,
Class propertyType,
String name,
String[] values,
String prefix)
FormBuilderThe documentation of the
previous replaceField method
contains more information about the functionality of this method.
replaceField in interface FormBuildertemplate - the template instance that will be used for the form
generationtemplateFieldName - the name of the form field that will be used to
look for supported value tags in the property templatepropertyType - the type of the propertyname - the name of the property that the form field will be
generated forvalues - the current values of the property, these are typically
the values that have been submitted previously through a web page. The
values will be used to pre-populate the form field with content.prefix - the prefix of the bean property names that should be used
while generating the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
FormBuilder.replaceField(Template, String, ConstrainedProperty, String[], String)
public void removeForm(Template template,
Class beanClass,
String prefix)
throws BeanUtilsException
FormBuilderFormBuilder.generateForm(Template, Class, Map, String)
method.
removeForm in interface FormBuildertemplate - the template instance whose values will be clearedbeanClass - the bean class whose properties will be analyzed for
clearing the form field valuesprefix - the prefix of the bean property names that should be used
while clearing the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property names
BeanUtilsException - when errors occurred during the clearing of
the formFormBuilder.generateForm(com.uwyn.rife.template.Template, java.lang.Class, java.util.Map, java.lang.String)
public void removeField(Template template,
String name,
String prefix)
FormBuilderFormBuilder.generateField(com.uwyn.rife.template.Template, com.uwyn.rife.site.ConstrainedProperty, java.lang.String[], java.lang.String)
method.
removeField in interface FormBuildertemplate - the template instance whose values will be clearedname - the name of the property for which the template value will
be clearedprefix - the prefix of the bean property names that should be used
while clearing the form, this is handy to use when the several forms
are present that use the same bean class or that has overlapping
property namesFormBuilder.generateField(com.uwyn.rife.template.Template, com.uwyn.rife.site.ConstrainedProperty, java.lang.String[], java.lang.String)
public void removeField(Template template,
String templateFieldName)
FormBuilderFormBuilder.replaceField(com.uwyn.rife.template.Template, java.lang.String, com.uwyn.rife.site.ConstrainedProperty, java.lang.String[], java.lang.String)
method.
removeField in interface FormBuildertemplate - the template instance whose values will be clearedtemplateFieldName - the that is use in the template values to
identify the property that has to be clearedFormBuilder.replaceField(Template, String, ConstrainedProperty, String[], String)
public Collection<String> selectParameter(Template template,
String name,
String[] values)
FormBuilder
selectParameter in interface FormBuildertemplate - the template instance that will be used for the
generationname - the name of the parametervalues - the values of the parameter
public void unselectParameter(Template template,
String name,
String[] values)
FormBuilder
unselectParameter in interface FormBuildertemplate - the template instance that will be used for the clearingname - the name of the parametervalues - the values of the parameterpublic ValidationBuilder getValidationBuilder()
FormBuilderValidationBuilder that is used by this
FormBuilder.
getValidationBuilder in interface FormBuilderFormBuilder's ValidationBuilderpublic Object clone()
clone in interface FormBuilderclone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||