Commit Graph

3 Commits

Author SHA1 Message Date
Florian Schmaus e626580f68 [xdata] Safe the raw character data of form field values
Related to SMACK-909.
2021-07-19 15:38:42 +02:00
Florian Schmaus c5212c20b6 [xdata] Rename FormReader.read(String) to getField(String)
Now that FormWriter, with its write() method, is gone, there is no
reason the FormReader method should still be named read(). Renaming to
getField() as this is what DataForm also uses.
2020-05-14 17:13:01 +02:00
Florian Schmaus 77e26fc575 Re-work data form API
Apply builder pattern to form fields and replace getVariable() with
getFieldName(). Refer to the field name as "field name" instead of
"variable" everyone, just as XEP-0004 does.

Improve the high-level form API: introduce FilledForm and FillableForm
which perform stronger validation and consistency checks.

Also add FormFieldRegistry to enable processing of 'submit' forms
where the form field types are omitted.

Smack also now does omit the form field type declaration on 'submit'
type forms, as it is allowed by XEP-0004.
2020-05-13 20:14:41 +02:00