Package org.springframework.web.servlet.mvc.method

Examples of org.springframework.web.servlet.mvc.method.RequestMappingInfo


                i++;
            }
        }
        PatternsRequestCondition patternsInfo = new PatternsRequestCondition(patterns);

        RequestMappingInfo modified = new RequestMappingInfo(patternsInfo,
                mapping.getMethodsCondition(), mapping.getParamsCondition(),
                mapping.getHeadersCondition(), mapping.getConsumesCondition(),
                mapping.getProducesCondition(), mapping.getCustomCondition());

        super.registerHandlerMethod(handler, method, modified);
View Full Code Here


   * @see #getCustomMethodCondition(Method)
   * @see #getCustomTypeCondition(Class)
   */
  @Override
  protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
    RequestMappingInfo info = null;
    RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
    if (methodAnnotation != null) {
      RequestCondition<?> methodCondition = getCustomMethodCondition(method);
      info = createRequestMappingInfo(methodAnnotation, methodCondition);
      RequestMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, RequestMapping.class);
View Full Code Here

  /**
   * Created a RequestMappingInfo from a RequestMapping annotation.
   */
  private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
    return new RequestMappingInfo(
        new PatternsRequestCondition(annotation.value(), getUrlPathHelper(), getPathMatcher(),
            this.useSuffixPatternMatch, this.useTrailingSlashMatch, this.fileExtensions),
        new RequestMethodsRequestCondition(annotation.method()),
        new ParamsRequestCondition(annotation.params()),
        new HeadersRequestCondition(annotation.headers()),
View Full Code Here

   * @see #getCustomMethodCondition(Method)
   * @see #getCustomTypeCondition(Class)
   */
  @Override
  protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
    RequestMappingInfo info = null;
    RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
    if (methodAnnotation != null) {
      RequestCondition<?> methodCondition = getCustomMethodCondition(method);
      info = createRequestMappingInfo(methodAnnotation, methodCondition);
      RequestMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, RequestMapping.class);
View Full Code Here

  /**
   * Created a RequestMappingInfo from a RequestMapping annotation.
   */
  private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
    return new RequestMappingInfo(
        new PatternsRequestCondition(annotation.value(),
            getUrlPathHelper(), getPathMatcher(), this.useSuffixPatternMatch, this.useTrailingSlashMatch),
        new RequestMethodsRequestCondition(annotation.method()),
        new ParamsRequestCondition(annotation.params()),
        new HeadersRequestCondition(annotation.headers()),
View Full Code Here

                }
            }

            Object handler = ctx.getBean(handlerServiceClass);
            Method serviceMethod = ClassUtils.getMethod(handlerServiceClass, methodName, paramTypes);
            RequestMappingInfo mapping = getMappingForMethod(method, marshallingServiceClass);

            if (relative) {
                List<String> patterns = new ArrayList<String>();

                for (String pattern : mapping.getPatternsCondition().getPatterns()) {
                    // add REST resource path prefix to URI,
                    // if relative path is just '/' add an empty string
                    patterns.add(restResource.path() + (!"/".equals(pattern) ? pattern : ""));
                }

                // create a new mapping based on the patterns (patterns are unmodifiable in existing RequestMappingInfo)
                mapping = new RequestMappingInfo(
                            new PatternsRequestCondition(patterns.toArray(ArrayUtils.EMPTY_STRING_ARRAY),
                                                         getUrlPathHelper(), getPathMatcher(),
                                                         useSuffixPatternMatch(), useTrailingSlashMatch()),
                            mapping.getMethodsCondition(), mapping.getParamsCondition(), mapping.getHeadersCondition(),
                            mapping.getConsumesCondition(), mapping.getProducesCondition(), mapping.getCustomCondition());
            }

            // need to set param types to use in createHandlerMethod before calling registerHandlerMethod
            restBridgedMethod = BridgeMethodResolver.findBridgedMethod(method);
View Full Code Here

    //遍历已映射的所有的url
    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

  public void scanSpringRequestMappings() {
    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();
View Full Code Here

  @Override
  public void execute(RequestMappingContext context) {
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");

    RequestMappingInfo requestMappingInfo = context.getRequestMappingInfo();
    ConsumesRequestCondition consumesCondition = requestMappingInfo.getConsumesCondition();
    ProducesRequestCondition producesRequestCondition = requestMappingInfo.getProducesCondition();

    Set<MediaType> consumesMediaTypes = consumesCondition.getConsumableMediaTypes();
    Set<MediaType> producesMediaTypes = producesRequestCondition.getProducibleMediaTypes();

    List<String> consumesList = toList(consumesMediaTypes);
View Full Code Here

    this.customAnnotationReaders = customAnnotationReaders;
  }

  @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);
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.mvc.method.RequestMappingInfo

Copyright © 2018 www.massapicom. 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.