1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00
Smack/documentation/developer/stanzas.md
Florian Schmaus d4a6d8e653 Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
2015-02-28 13:49:38 +01:00

512 B

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

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).