Package rocks.xmpp.websocket.codec
Class XmppWebSocketDecoder
- java.lang.Object
-
- rocks.xmpp.websocket.codec.XmppWebSocketDecoder
-
- All Implemented Interfaces:
javax.websocket.Decoder
,javax.websocket.Decoder.TextStream<StreamElement>
public final class XmppWebSocketDecoder extends Object implements javax.websocket.Decoder.TextStream<StreamElement>
Decodes WebSocket text messages to XMPPStreamElement
s.The required
Unmarshaller
for decoding must be supplied viaEndpointConfig.getUserProperties()
, seeXmppWebSocketDecoder.UserProperties.UNMARSHALLER
.Optionally you can also provide a callback, which is called after unmarshalling with the XML string (the text message) and the unmarshalled element. This is useful for debugging purposes, see
XmppWebSocketDecoder.UserProperties.ON_READ
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XmppWebSocketDecoder.UserProperties
User properties for usage inEndpointConfig.getUserProperties()
.
-
Constructor Summary
Constructors Constructor Description XmppWebSocketDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamElement
decode(Reader reader)
void
destroy()
void
init(javax.websocket.EndpointConfig config)
-
-
-
Method Detail
-
decode
public final StreamElement decode(Reader reader) throws javax.websocket.DecodeException, IOException
- Specified by:
decode
in interfacejavax.websocket.Decoder.TextStream<StreamElement>
- Throws:
javax.websocket.DecodeException
IOException
-
init
public final void init(javax.websocket.EndpointConfig config)
- Specified by:
init
in interfacejavax.websocket.Decoder
-
destroy
public final void destroy()
- Specified by:
destroy
in interfacejavax.websocket.Decoder
-
-