public final class XmppWebSocketEncoder extends java.lang.Object implements javax.websocket.Encoder.Text<StreamElement>
Encodes XMPP StreamElements to WebSocket text messages.
The required Marshaller for encoding must be supplied via EndpointConfig.getUserProperties(), see XmppWebSocketEncoder.UserProperties.MARSHALLER.
Optionally you can also provide a callback, which is called after marshalling with the encoded text message (the XML string) and the stream element. This is useful for debugging purposes, see XmppWebSocketEncoder.UserProperties.ON_WRITE.
| Modifier and Type | Class and Description |
|---|---|
static class |
XmppWebSocketEncoder.UserProperties
User properties for usage in
EndpointConfig.getUserProperties(). |
| Constructor and Description |
|---|
XmppWebSocketEncoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
java.lang.String |
encode(StreamElement object) |
void |
init(javax.websocket.EndpointConfig config) |
public final java.lang.String encode(StreamElement object) throws javax.websocket.EncodeException
encode in interface javax.websocket.Encoder.Text<StreamElement>javax.websocket.EncodeExceptionpublic final void init(javax.websocket.EndpointConfig config)
init in interface javax.websocket.Encoderpublic final void destroy()
destroy in interface javax.websocket.EncoderCopyright © 2014–2019 XMPP.rocks. All rights reserved.