Class GenericResultHandlerService

java.lang.Object
org.springframework.shell.result.GenericResultHandlerService
All Implemented Interfaces:
ResultHandlerService

public class GenericResultHandlerService extends Object implements ResultHandlerService
Base implementation suitable for use in most environments.
  • Constructor Details

    • GenericResultHandlerService

      public GenericResultHandlerService()
  • Method Details

    • handle

      public void handle(Object source)
      Description copied from interface: ResultHandlerService
      Handle result.
      Specified by:
      handle in interface ResultHandlerService
      Parameters:
      source - the result
    • handle

      public void handle(Object result, org.springframework.core.convert.TypeDescriptor resultType)
      Description copied from interface: ResultHandlerService
      Handle result to the specified TypeDescriptor.
      Specified by:
      handle in interface ResultHandlerService
      Parameters:
      result - the result
      resultType - the result type
    • addResultHandler

      public void addResultHandler(ResultHandler<?> resultHandler)
      Add a plain result handler to this registry.
      Parameters:
      resultHandler - the result handler
    • addResultHandler

      public <T> void addResultHandler(Class<T> resultType, ResultHandler<? super T> resultHandler)
      Add a plain result handler to this registry.
      Type Parameters:
      T - the type of result handler
      Parameters:
      resultType - the class of a result type
      resultHandler - the result handler
    • addResultHandler

      public void addResultHandler(GenericResultHandler handler)
      Add a generic result handler this this registry.
      Parameters:
      handler - the generic result handler