Examples of HandlerMethod


Examples of org.springframework.web.method.HandlerMethod

   * @return
   * @throws Exception
   */
  protected String getViewNameFromRequest() throws Exception {
    HandlerExecutionChain execution = getHandler(getCurrentRequestAttributes().getRequest());
    HandlerMethod hm = (HandlerMethod) execution.getHandler();
    String name = hm.getMethod().getName();
   
    if (hm.getMethod().isAnnotationPresent(ResponseMapping.class)) {
      ResponseMapping responseMapping = hm.getMethod().getAnnotation(ResponseMapping.class);
      name = responseMapping.value()[0];
    }
   
    return name;
  }
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

    Map<RequestMappingInfo, HandlerMethod>  map=this.handlerMapping.getHandlerMethods();
    Iterator<Map.Entry<RequestMappingInfo, HandlerMethod>> it=map.entrySet().iterator();
    while(it.hasNext()){
      Map.Entry<RequestMappingInfo, HandlerMethod> entry=it.next();
      RequestMappingInfo rm=entry.getKey();
      HandlerMethod hm=entry.getValue();
      System.out.println(rm.getPatternsCondition().toString().replace("[", "").replace("]", ""));
    }
   
    System.out.println(xmlReader.getSQL("user-userManager-findAllUser-1"));;
    demoService.save();
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

public class OperationParameterReader extends SwaggerParameterReader {

  @Override
  protected Collection<? extends Parameter> readParameters(final RequestMappingContext context) {
    HandlerMethod handlerMethod = context.getHandlerMethod();
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
    HandlerMethodResolver handlerMethodResolver
            = new HandlerMethodResolver(swaggerGlobalSettings.getTypeResolver());

    List<ResolvedMethodParameter> methodParameters = handlerMethodResolver.methodParameters(handlerMethod);
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

    Map<ResourceGroup, String> resourceGroupDescriptions = new HashMap<ResourceGroup, String>();
    for (RequestMappingHandlerMapping requestMappingHandlerMapping : this.requestMappingHandlerMapping) {
      for (Entry<RequestMappingInfo, HandlerMethod> handlerMethodEntry :
              requestMappingHandlerMapping.getHandlerMethods().entrySet()) {
        RequestMappingInfo requestMappingInfo = handlerMethodEntry.getKey();
        HandlerMethod handlerMethod = handlerMethodEntry.getValue();
        if (shouldIncludeRequestMapping(requestMappingInfo, handlerMethod)) {
          Set<ResourceGroup> resourceGroups = resourceGroupingStrategy.getResourceGroups(requestMappingInfo,
                  handlerMethod);
          String handlerMethodName = handlerMethod.getMethod().getName();

          String resourceDescription = resourceGroupingStrategy.getResourceDescription(requestMappingInfo,
                  handlerMethod);
          RequestMappingContext requestMappingContext = new RequestMappingContext(requestMappingInfo,
                  handlerMethod);
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

  }

  @Override
  public void execute(RequestMappingContext context) {
    RequestMappingInfo requestMappingInfo = context.getRequestMappingInfo();
    HandlerMethod handlerMethod = context.getHandlerMethod();
    PatternsRequestCondition patternsCondition = requestMappingInfo.getPatternsCondition();

    List<ApiDescription> apiDescriptionList = newArrayList();
    for (String pattern : patternsCondition.getPatterns()) {
      String cleanedRequestMappingPath = sanitizeRequestMappingPattern(pattern);
      String path = swaggerPathProvider.getOperationPath(cleanedRequestMappingPath);
      String methodName = handlerMethod.getMethod().getName();
      context.put("requestMappingPattern", cleanedRequestMappingPath);
      ApiOperationReader apiOperationReader = new ApiOperationReader(customAnnotationReaders);
      apiOperationReader.execute(context);
      List<Operation> operations = (List<Operation>) context.get("operations");
      apiDescriptionList.add(new ApiDescription(path, toOption(methodName), toScalaList(operations)));
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

public class OperationNotesReader implements RequestMappingReader {
  @Override
  public void execute(RequestMappingContext context) {

    HandlerMethod handlerMethod = context.getHandlerMethod();
    String notes = handlerMethod.getMethod().getName();
    ApiOperation methodAnnotation = handlerMethod.getMethodAnnotation(ApiOperation.class);
    if ((null != methodAnnotation) && !StringUtils.isBlank(methodAnnotation.notes())) {
      notes = methodAnnotation.notes();
    }
    context.put("notes", notes);
  }
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

public class OperationImplicitParametersReader extends SwaggerParameterReader {

  @Override
  protected Collection<Parameter> readParameters(RequestMappingContext context) {
    HandlerMethod handlerMethod = context.getHandlerMethod();
    Method method = handlerMethod.getMethod();
    ApiImplicitParams annotation = AnnotationUtils.findAnnotation(method, ApiImplicitParams.class);

    List<Parameter> parameters = Lists.newArrayList();
    if (null != annotation) {
      for (ApiImplicitParam param : annotation.value()) {
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

  @Override
  public void execute(RequestMappingContext context) {
    AuthorizationContext authorizationContext = (AuthorizationContext) context.get("authorizationContext");

    HandlerMethod handlerMethod = context.getHandlerMethod();
    String requestMappingPattern = (String) context.get("requestMappingPattern");
    List<com.wordnik.swagger.model.Authorization> authorizations = newArrayList();

    if (null != authorizationContext) {
      authorizations = authorizationContext.getAuthorizationsForPath(requestMappingPattern);
    }

    ApiOperation apiOperationAnnotation = handlerMethod.getMethodAnnotation(ApiOperation.class);

    if (null != apiOperationAnnotation && null != apiOperationAnnotation.authorizations()) {
      Authorization[] authorizationAnnotations = apiOperationAnnotation.authorizations();
      if (authorizationAnnotations != null
              && authorizationAnnotations.length > 0
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

public class OperationImplicitParameterReader extends SwaggerParameterReader {

  @Override
  protected Collection<? extends Parameter> readParameters(RequestMappingContext context) {
    HandlerMethod handlerMethod = context.getHandlerMethod();
    Method method = handlerMethod.getMethod();
    ApiImplicitParam annotation = AnnotationUtils.findAnnotation(method, ApiImplicitParam.class);
    List<Parameter> parameters = Lists.newArrayList();
    if (null != annotation) {
      parameters.add(OperationImplicitParameterReader.getImplicitParameter(annotation));
    }
View Full Code Here

Examples of org.springframework.web.method.HandlerMethod

  @Override
  public void execute(RequestMappingContext context) {
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
    RequestMethod currentHttpMethod = (RequestMethod) context.get("currentHttpMethod");
    HandlerMethod handlerMethod = context.getHandlerMethod();

    Collection<ResponseMessage> responseMessages = newArrayList();
    responseMessages.addAll(read(swaggerGlobalSettings, currentHttpMethod, handlerMethod));
    context.put("responseMessages", responseMessages);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.