-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAcmeChatTextDecoder.java
More file actions
37 lines (31 loc) · 963 Bytes
/
AcmeChatTextDecoder.java
File metadata and controls
37 lines (31 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package org.javaee7.chapter09;
import javax.websocket.DecodeException;
import javax.websocket.EndpointConfig;
/**
*
* @author Juneau
*/
public class AcmeChatTextDecoder implements javax.websocket.Decoder.Text<AcmeChatObj> {
@Override
public AcmeChatObj decode(String s) throws DecodeException {
AcmeChatObj obj = new AcmeChatObj();
obj.setMessage(s);
return obj;
}
@Override
public boolean willDecode(String s) {
if (s != null) {
return true;
} else {
return false;
}
}
@Override
public void init(EndpointConfig config) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void destroy() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}