Interface MethodParser


public interface MethodParser
Action method parsing: parses method parameters, parses method return value
Author:
渔民小镇
date:
2022-06-26
  • Method Details

    • getActualClazz

      Class<?> getActualClazz(ActualParameter parameterReturn)
      Get the actual class for the parameter or return type.

      For primitive-wrapper parsers this returns the corresponding protocol wrapper class (e.g. IntValue, IntValueList). For the default parser it delegates to ActualParameter.getActualTypeArgumentClass().

      Parameters:
      parameterReturn - the parameter or return type metadata
      Returns:
      the actual class to use for codec operations
    • parseParam

      Object parseParam(byte[] data, ActionMethodParameter actionMethodParameter, DataCodec codec)
      Parses action method parameters
      Parameters:
      data - data
      actionMethodParameter - paramInfo
      codec - codec
      Returns:
      The parsed data
    • parseDataList

      Object parseDataList(Object data, DataCodec codec)
      Parse a list of data values into the protocol-compatible format.

      Wraps the given list into the appropriate value-list wrapper type for serialization.

      Parameters:
      data - the list of values returned by the action method
      codec - the data codec for encoding individual elements
      Returns:
      the protocol-compatible list wrapper object
    • parseData

      Object parseData(Object data)
      Parse a single data value into the protocol-compatible format.

      Wraps the given value into the appropriate value wrapper type for serialization.

      Parameters:
      data - the value returned by the action method
      Returns:
      the protocol-compatible wrapper object