Package rocks.xmpp.websocket.codec
Class XmppWebSocketEncoder
- java.lang.Object
-
- rocks.xmpp.websocket.codec.XmppWebSocketEncoder
-
- All Implemented Interfaces:
javax.websocket.Encoder,javax.websocket.Encoder.TextStream<StreamElement>
public final class XmppWebSocketEncoder extends Object implements javax.websocket.Encoder.TextStream<StreamElement>
Encodes XMPPStreamElements to WebSocket text messages.The required
Marshallerfor encoding must be supplied viaEndpointConfig.getUserProperties(), seeXmppWebSocketEncoder.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXmppWebSocketEncoder.UserPropertiesUser properties for usage inEndpointConfig.getUserProperties().
-
Constructor Summary
Constructors Constructor Description XmppWebSocketEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voidencode(StreamElement object, Writer writer)voidinit(javax.websocket.EndpointConfig config)
-
-
-
Method Detail
-
encode
public final void encode(StreamElement object, Writer writer) throws javax.websocket.EncodeException, IOException
- Specified by:
encodein interfacejavax.websocket.Encoder.TextStream<StreamElement>- Throws:
javax.websocket.EncodeExceptionIOException
-
init
public final void init(javax.websocket.EndpointConfig config)
- Specified by:
initin interfacejavax.websocket.Encoder
-
destroy
public final void destroy()
- Specified by:
destroyin interfacejavax.websocket.Encoder
-
-