Commit Graph

24 Commits

Author SHA1 Message Date
Florian Schmaus 3d4e7938a7 Make ExtensionElement marker interface wrt. QNAME field
ExtensionElement is now a marker interface that requires all
implementation non-abstract classes to carry a static final QNAME
field (of type QName). This is verified by a new unit test.

Also FullyQualifiedElement is renamed to simply XmlElement. XmlElement
is used over ExtensionElement when implementing classes do not
statically know the qualified name of the XML elements they
represent. In general, XmlElement should be used sparingly, and every
XML element should be modeled by its own Java class (implementing
ExtensionElement).
2021-04-18 21:07:19 +02:00
Florian Schmaus 07da9ffb48 Do not have Stanza.getExtension(String, String) return a generic type
Returning a generic would allow for

List<ExtensionElement> list = stanza.getExtension("foo", "bar");

to compile (Note the we are calling getExtension(), not
getExtension*s*()).

Users are encouraged to use the type safe getExtension(Class<? extends
ExtensionElement) variant instead.

Fixes SMACK-825.
2020-04-05 22:10:05 +02:00
Florian Schmaus e2d206e741 Introduce XMPPConnection.add(Message|Presence)Interceptor
add deprecate addStanzaInterceptor().
2019-10-25 21:41:55 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
Florian Schmaus 8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus 083dac8b83 Rework exceptions in the parsing / provider subsystem 2019-02-05 13:18:03 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus 105192d7e7 Only announce support for ChatMarkers if there is a listener 2018-09-06 20:24:41 +02:00
Florian Schmaus 0fa6fb946c Remove broken methods in ChatMarkersManager 2018-09-06 20:24:41 +02:00
Florian Schmaus 0778485243 Deduplicate code ChatMarkersElements
by introducing ChatMarkerExtensionWithId.
2018-09-06 20:24:41 +02:00
Florian Schmaus 36bfa060a5 Ensure the ID is given in ChatMarkersElements 2018-09-06 20:24:41 +02:00
Florian Schmaus 3547fde91c Rename EligibleForChatMarker to EligibleForChatMarkerFilter 2018-09-06 20:24:41 +02:00
Florian Schmaus 3f1b18636e Use Message.hasStanzaIdSet() in EligibleForChatMarker filter 2018-09-06 20:24:41 +02:00
Florian Schmaus 0b9cce507d Use asEntityBareJidOrThrow() in ChatMarkersManager listener 2018-09-06 20:24:41 +02:00
Florian Schmaus b12f5a1591 Make MarkableExtension a singleton
to reduce pressure on the memory subsystem.
2018-09-06 20:24:41 +02:00
Florian Schmaus 45736e8ead Remove NORMAL_OR_CHAT_OR_GROUPCHAT MessageTypeFilter
Type 'groupchat' message stanzas are not like others, they usually
require special handling. Hence such a filter is usually an indication
that multiple concepts are intermixed.
2018-09-06 18:42:41 +02:00
Florian Schmaus 830f3661e7 Avoid getInstanceOf() in listener as it is a costly operation 2018-09-06 18:41:19 +02:00
Miguel Hincapie 547138b325 Improve ChatMarkersManager
* Created filters to be used with incoming and outgoing message stanzas
* Added a list of ChatMarkersListener and its add and remove methods.
* Added a stanza listener for outgoing messages.
* Added a stanza listener for incoming messages.
* Added discover feature for XEP-0333.
* Added methods to inform a message was: received, displayed or ack
* Added javadoc autor tag.
2018-09-06 18:39:00 +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 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
Fernando Ramirez 6d74d0383c Add support for XEP-0333: Chat Markers
Fixes SMACK-736
2016-11-15 22:49:26 +01:00