mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-16 20:22:05 +01:00
d4a6d8e653
to StanzaFilter and ExtensionElement.
17 lines
512 B
Markdown
17 lines
512 B
Markdown
PacketExtension
|
|
===============
|
|
|
|
The static `from(Stanza)` Method
|
|
--------------------------------
|
|
|
|
Every PacketExtension class must have a static `from()` method that retrieves that extension for a given Stanza (if any).
|
|
|
|
Sample Code
|
|
|
|
```java
|
|
public static RSMSet from(Stanza) {
|
|
return packet.getExtension(ELEMENT, NAMESPACE);
|
|
}
|
|
```
|
|
|
|
Sometimes certain PacketExtension's are only found in one stanza type, in that case, specify the parameter type. For example `public static CarbonExtension getFrom(Message)`.
|