mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
PacketExtension.from(Packet), deprecate getFrom()
add 'from(Packet)' to DataForm
This commit is contained in:
parent
f0651bae2d
commit
58e430af42
14 changed files with 158 additions and 13 deletions
25
documentation/developer/stanzas.md
Normal file
25
documentation/developer/stanzas.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
Developer Documentation: Stanzas and PacketExtensions
|
||||
|
||||
PacketExtension
|
||||
===============
|
||||
|
||||
The static `from(Packet)` 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(Packet) {
|
||||
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)`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue