PojoMessageHandlerWholeText (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.tomcat.websocket.pojo, class: PojoMessageHandlerWholeText

# Class PojoMessageHandlerWholeText

java.lang.Object
org.apache.tomcat.websocket.pojo.PojoMessageHandlerBase<String>
org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase<String>
org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeText

All Implemented Interfaces:
  `MessageHandler, MessageHandler.Whole<String>, WrappedMessageHandler`

public class PojoMessageHandlerWholeText extends PojoMessageHandlerWholeBase<String>
Text specific concrete implementation for handling whole messages.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface MessageHandler

  `MessageHandler.Partial<T>, MessageHandler.Whole<T>`

- ## Field Summary

  ### Fields inherited from class PojoMessageHandlerWholeBase

  `decoders`

  ### Fields inherited from class PojoMessageHandlerBase

  `convert, indexPayload, indexSession, maxMessageSize, method, params, pojo, session`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PojoMessageHandlerWholeText(Object pojo, Method method, Session session, EndpointConfig config, List<Class<? extends Decoder>> decoderClazzes, Object[] params, int indexPayload, boolean convert, int indexSession, long maxMessageSize)`
  Create a whole text message handler.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Object`
  `convert(String message)`
  Convert the message to the type expected by the target method.
  `protected Object`
  `decode(String message)`
  Decode the message using the registered decoders.

  ### Methods inherited from class PojoMessageHandlerWholeBase

  `createDecoderInstance, onClose, onMessage`

  ### Methods inherited from class PojoMessageHandlerBase

  `getMaxMessageSize, getWrappedHandler, handlePojoMethodException, processResult`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PojoMessageHandlerWholeText

    public PojoMessageHandlerWholeText(Object pojo, Method method, Session session, EndpointConfig config, List<Class<? extends Decoder>> decoderClazzes, Object[] params, int indexPayload, boolean convert, int indexSession, long maxMessageSize)
    Create a whole text message handler.
    Parameters:
      `pojo` - POJO instance
      `method` - Method to invoke
      `session` - WebSocket session
      `config` - Endpoint configuration
      `decoderClazzes` - List of decoder classes
      `params` - Pre-populated parameter array
      `indexPayload` - Index of the payload parameter
      `convert` - Convert the message before passing to the method
      `indexSession` - Index of the session parameter
      `maxMessageSize` - Maximum message size

- ## Method Details

  - ### decode

    protected Object decode(String message) throws DecodeException
    Description copied from class: `PojoMessageHandlerWholeBase`
    Decode the message using the registered decoders.
    Specified by:
      `decode` in class `PojoMessageHandlerWholeBase<String>`
    Parameters:
      `message` - Message to decode
    Returns:
      Decoded message or `null` if no decoder could decode it
    Throws:
      `DecodeException` - If the message cannot be decoded

  - ### convert

    protected Object convert(String message)
    Description copied from class: `PojoMessageHandlerWholeBase`
    Convert the message to the type expected by the target method.
    Overrides:
      `convert` in class `PojoMessageHandlerWholeBase<String>`
    Parameters:
      `message` - Message to convert
    Returns:
      Converted message