Commit Graph

33 Commits

Author SHA1 Message Date
Simon Abykov 19270a2eca Accept an empty string as the label value 2021-10-20 10:12:29 +01:00
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 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
Florian Schmaus 65576cf3c2 Rework XML Element hierarchy and XmlStringBuilder
- Reduce the amount of types that are subtypes of NamedElement. See
javadoc of NamedElement for rationale.
- Work more with XmlEnvironment in XmlStringBuilder.
- Some minor changes to XmlStringBuilder API.
2019-09-07 18:17:08 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus fa0c16d75c Introduce EqualsUtil and HashCode.(Builder|Cache) 2019-06-12 14:51:17 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus 1a99801501 Fix typo in FormField's javadoc: s/fold/field/ 2019-06-05 10:54:17 +02:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus b7ea226c56 Bump "Error Prone" to 2.3.2
and gradle-errorprone-plugin to 0.6.
2018-10-31 16:06:31 +01:00
Florian Schmaus ab120691cb Smack 4.3.1
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlvDIBdfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFKObAgApvEwstvSXhgzlrA46DM6fXezbPEnO1rh8rCPJEAsmfBSnyINSuuhelzw
 zN8L7GAU0jDeuDivxA12vQx5QB8wuCHKgc5pXDKNRi9eUdsyDUMKswcbMMAJWDvq
 I3bm7TOC1D9ZWmfhGmqfulrsVD1Q0wh+P2A1/CWVR5ZZUB5S4fESFZUrnCfJmeXe
 f+INXUiui3otAF6nPxKm782rSfHWvA32i4Obnagh3oPX/c9R7Ftb78Wukrsbaqfg
 +a5iTlBJXLG75/Yozq+JqmWlUvEKv7le0vkF5fF+oc76H4p1U1wqQyIMei/Pwaer
 H/SyMqLPzCiwpUHiunpWD13e5kkeLw==
 =47on
 -----END PGP SIGNATURE-----

Merge tag '4.3.1'

Smack 4.3.1
2018-10-14 14:31:31 +02:00
Florian Schmaus ec982f65e2 Fix IndexOutOfBoundsException in FormField.getFirstValue()
Fixes SMACK-838.
2018-10-14 12:07:51 +02:00
Paul Schaub 74bebc13e6
requireNotNullOrEmpty -> requireNotNullNorEmpty 2018-07-17 15:10:39 +02:00
Florian Schmaus d26baeb66f Add Date API methods to FormField values 2018-06-03 17:29:09 +02:00
Florian Schmaus 298bcc8097 Improve FormField.resetValues()
by using clear() instead of removeAll().
2018-06-03 17:29:09 +02:00
Florian Schmaus e8923b9d16 Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
2018-05-09 23:26:39 +02:00
Florian Schmaus 5ab2903c32 Change Element.toXml() to toXml(String enclosingNamespace) 2018-04-27 10:05:25 +02:00
Florian Schmaus 1d88c857b5 Change FormField value(s) type from String to CharSequence 2018-04-06 13:24:54 +02:00
Paul Schaub cb18056613 Fix minor codestyle issues 2017-12-17 11:03:46 +01:00
Florian Schmaus 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
Florian Schmaus 4c646436a5 Bump "Error Prone" to 2.0.15
and fix a few things :)
2017-02-11 16:16:41 +01:00
Florian Schmaus 265e5c69d5 Use LinkedHashMap for form fields
for efficient lookup.
2015-04-12 19:27:22 +02:00
Florian Schmaus dc373f641c Make Smack Java8's javac and javadoc ready 2015-04-04 17:16:27 +02:00
Florian Schmaus 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00
Florian Schmaus 2cba6a68eb Fix DataFormProvider parsing 'fixed' FormFields
b71039660b made FormField.setType(Type)
throw an illegal argument exception if type is fixed, but the
DataFormProvider was not changed, so it still would call
setType(Type.fixed).

Change DataFormProvider so that the non-argument constructer of
FormField is used when type == fixed.
2015-01-26 07:54:12 +01:00
Florian Schmaus b265d2d2a2 Add XDataManager.isSupported(String)
also make FormField and Option implement NamedElement and some other
minor changes to data form API.
2015-01-21 09:50:50 +01:00
Florian Schmaus b71039660b Improve data form API
Add

DataForm.getField(String)
DataForm.getHiddenFormTypeField()
2015-01-10 18:05:05 +01:00
Anno van Vliet b08dbc1dbc Support for XEP-0122: Data Forms Validation.
Data Forms Validation are a part of Data Fields and implemented as
extensions, added to a Datafield.

Data validation extensions are validated before adding to the message,
using the consistency rules as described in the XEP.
Fixes SMACK-621.

Minor modifications done by Florian Schmaus <flo@geekplace.eu>
2014-12-30 02:03:12 +01:00
Florian Schmaus 755765120d Make FormField.Type an enum 2014-12-27 21:12:48 +01:00
Florian Schmaus bbf89c65bf Fix typo in XmlStringBuilder, it's not an Angel
s/rightAngelBracket/rightAngleBracket/
2014-08-20 21:25:14 +02:00
Florian Schmaus 0b6069d75f Fix FormField.Option.toXML() to use correct element
Fixes SMACK-589
2014-07-30 21:58:10 +02:00
Florian Schmaus 26b5bc0212 Properly escape Bookmarks and FormField XML
by using XmlStringBuilder. Fixes SMACK-577

Also extend LazyStringBuilder with a cache. And extend XmlStringBuilder
with some more convenience methods.

Move the ELEMENT and NAMESPACE definition from Form to DataForm, where
it belongs.
2014-06-19 16:52:19 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00
Renamed from extensions/src/main/java/org/jivesoftware/smackx/xdata/FormField.java (Browse further)