Class ResultReturnResolver

java.lang.Object
com.sap.cds.services.impl.handlerregistry.resolver.ResultReturnResolver
All Implemented Interfaces:
ReturnResolver

public class ResultReturnResolver extends Object implements ReturnResolver
Handles handler methods returning instances of Result or Row or more generically Iterable<? extends Map<String, ?>> or Map<String, ?> The resolver works only for CqnService events.
  • Method Details

    • createIfApplicable

      public static ResultReturnResolver createIfApplicable(Type type)
      True, if the class and generic type are applicable for this resolver
      Parameters:
      type - the generic return type
      Returns:
      true, if the class is equal to Result or Row or more generically Iterable<? extends Map<String, ?>> or Map<String, ?>
    • resolve

      public void resolve(Object returnValue, EventContext context)
      Description copied from interface: ReturnResolver
      Resolves the return value against the given EventContext. The method should put the return value on the EventContext under the expected key.
      Specified by:
      resolve in interface ReturnResolver
      Parameters:
      returnValue - the return value
      context - the context, which is currently being processed
    • verifyOrThrow

      public void verifyOrThrow(HandlerDescriptor descriptor)
      Description copied from interface: ReturnResolver
      Verifies the resolver, based on the final HandlerDescriptor.
      Specified by:
      verifyOrThrow in interface ReturnResolver
      Parameters:
      descriptor - the HandlerDescriptor