1.1 --- a/json/src/main/java/org/apidesign/html/json/spi/Proto.java Mon Jan 06 08:37:00 2014 +0100
1.2 +++ b/json/src/main/java/org/apidesign/html/json/spi/Proto.java Mon Jan 06 08:49:02 2014 +0100
1.3 @@ -495,14 +495,18 @@
1.4 */
1.5 protected abstract Proto protoFor(Object object);
1.6
1.7 - /**
1.8 + /** Called to report results of asynchronous over-the-wire
1.9 + * communication. Result of calling {@link Proto#wsOpen(int, java.lang.String, java.lang.Object)}
1.10 + * or {@link Proto#loadJSON(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)}.
1.11 *
1.12 - * @param model
1.13 - * @param index
1.14 - * @param type 0 - onOpen, 1 - onMessage, 2 - onError, 3 - onClose
1.15 - * @param data
1.16 + * @param model the instance of the model class
1.17 + * @param index index used during initiating the communication (via <code>loadJSON</code> or <code>wsOpen</code> calls)
1.18 + * @param type type of the message: 0 - onOpen, 1 - onMessage, 2 - onError, 3 - onClose -
1.19 + * not all messages are applicable to all communication protocols (JSON has only 1 and 2).
1.20 + * @param data <code>null</code> or string, number or a {@link Model} class
1.21 + * obtained to the server as a response
1.22 */
1.23 - public abstract void onMessage(Model model, int index, int type, Object data);
1.24 + protected abstract void onMessage(Model model, int index, int type, Object data);
1.25
1.26 //
1.27 // Various support methods the generated classes use