Package org.springframework.web.bind.annotation

Examples of org.springframework.web.bind.annotation.PathVariable


* @see PathVariableMethodArgumentResolver
*/
public class PathVariableMapMethodArgumentResolver implements HandlerMethodArgumentResolver {

  public boolean supportsParameter(MethodParameter parameter) {
    PathVariable annot = parameter.getParameterAnnotation(PathVariable.class);
    return ((annot != null) && (Map.class.isAssignableFrom(parameter.getParameterType()))
        && (!StringUtils.hasText(annot.value())));
  }
View Full Code Here


          required = cookieValue.required();
          defaultValue = parseDefaultValueAttribute(cookieValue.defaultValue());
          annotationsFound++;
        }
        else if (PathVariable.class.isInstance(paramAnn)) {
          PathVariable pathVar = (PathVariable) paramAnn;
          pathVarName = pathVar.value();
          annotationsFound++;
        }
        else if (ModelAttribute.class.isInstance(paramAnn)) {
          ModelAttribute attr = (ModelAttribute) paramAnn;
          attrName = attr.value();
View Full Code Here

        else if (ModelAttribute.class.isInstance(paramAnn)) {
          throw new IllegalStateException(
              "@ModelAttribute is not supported on @InitBinder methods: " + initBinderMethod);
        }
        else if (PathVariable.class.isInstance(paramAnn)) {
          PathVariable pathVar = (PathVariable) paramAnn;
          pathVarName = pathVar.value();
        }
      }

      if (paramName == null && pathVarName == null) {
        Object argValue = resolveCommonArgument(methodParam, webRequest);
View Full Code Here

    return parameter.hasParameterAnnotation(PathVariable.class);
  }

  @Override
  protected NamedValueInfo createNamedValueInfo(MethodParameter parameter) {
    PathVariable annotation = parameter.getParameterAnnotation(PathVariable.class);
    return new PathVariableNamedValueInfo(annotation);
  }
View Full Code Here

    return true;
  }

  @Override
  protected NamedValueInfo createNamedValueInfo(MethodParameter parameter) {
    PathVariable annotation = parameter.getParameterAnnotation(PathVariable.class);
    return new PathVariableNamedValueInfo(annotation);
  }
View Full Code Here

*/
public class PathVariableMapMethodArgumentResolver implements HandlerMethodArgumentResolver {

  @Override
  public boolean supportsParameter(MethodParameter parameter) {
    PathVariable ann = parameter.getParameterAnnotation(PathVariable.class);
    return (ann != null && (Map.class.isAssignableFrom(parameter.getParameterType()))
        && !StringUtils.hasText(ann.value()));
  }
View Full Code Here

    return true;
  }

  @Override
  protected NamedValueInfo createNamedValueInfo(MethodParameter parameter) {
    PathVariable annotation = parameter.getParameterAnnotation(PathVariable.class);
    return new PathVariableNamedValueInfo(annotation);
  }
View Full Code Here

    if (Map.class.isAssignableFrom(parameter.getParameterType())) {
      return;
    }

    PathVariable ann = parameter.getParameterAnnotation(PathVariable.class);
    String name = (ann == null || StringUtils.isEmpty(ann.value()) ? parameter.getParameterName() : ann.value());
    value = formatUriValue(conversionService, new TypeDescriptor(parameter), value);
    uriVariables.put(name, value);
  }
View Full Code Here

          required = cookieValue.required();
          defaultValue = parseDefaultValueAttribute(cookieValue.defaultValue());
          annotationsFound++;
        }
        else if (PathVariable.class.isInstance(paramAnn)) {
          PathVariable pathVar = (PathVariable) paramAnn;
          pathVarName = pathVar.value();
          annotationsFound++;
        }
        else if (ModelAttribute.class.isInstance(paramAnn)) {
          ModelAttribute attr = (ModelAttribute) paramAnn;
          attrName = attr.value();
View Full Code Here

        else if (ModelAttribute.class.isInstance(paramAnn)) {
          throw new IllegalStateException(
              "@ModelAttribute is not supported on @InitBinder methods: " + initBinderMethod);
        }
        else if (PathVariable.class.isInstance(paramAnn)) {
          PathVariable pathVar = (PathVariable) paramAnn;
          pathVarName = pathVar.value();
        }
      }

      if (paramName == null && pathVarName == null) {
        Object argValue = resolveCommonArgument(methodParam, webRequest);
View Full Code Here

TOP

Related Classes of org.springframework.web.bind.annotation.PathVariable

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.