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 XMPPStreamElements.The required
Unmarshallerfor 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 classXmppWebSocketDecoder.UserPropertiesUser properties for usage inEndpointConfig.getUserProperties().
-
Constructor Summary
Constructors Constructor Description XmppWebSocketDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamElementdecode(Reader reader)voiddestroy()voidinit(javax.websocket.EndpointConfig config)
-
-
-
Method Detail
-
decode
public final StreamElement decode(Reader reader) throws javax.websocket.DecodeException, IOException
- Specified by:
decodein interfacejavax.websocket.Decoder.TextStream<StreamElement>- Throws:
javax.websocket.DecodeExceptionIOException
-
init
public final void init(javax.websocket.EndpointConfig config)
- Specified by:
initin interfacejavax.websocket.Decoder
-
destroy
public final void destroy()
- Specified by:
destroyin interfacejavax.websocket.Decoder
-
-