if (textMessage == null) {
onError(s, JsrWebSocketMessages.MESSAGES.receivedTextFrameButNoMethod());
return;
}
if (assembledTextFrame == null) {
assembledTextFrame = new UTF8Output();
}
UTF8Output builder = assembledTextFrame;
builder.write(payload);
if (header.isLastFragement() || (textMessage.hasParameterType(boolean.class) && !textMessage.isDecoderRequired() && builder.hasData())) {
Object messageObject;
if (textMessage.isDecoderRequired()) {
try {
messageObject = session.getEncoding().decodeText(textMessage.getMessageType(), builder.extract());
} catch (DecodeException e) {
onError(s, e);
return;
}
} else if (textMessage.getMessageType().equals(Reader.class)) {
messageObject = new StringReader(builder.extract());
} else {
messageObject = builder.extract();
}
final Map<Class<?>, Object> params = new HashMap<Class<?>, Object>();
params.put(Session.class, session);
params.put(Map.class, session.getPathParameters());