javax.ws.rs.QueryParam.value()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.ws.rs.QueryParam.value方法的一些代码示例,展示了QueryParam.value的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryParam.value方法的具体详情如下:
包路径:javax.ws.rs.QueryParam
类名称:QueryParam
方法名:value

QueryParam.value介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

@Override
public String getValueOf(QueryParam a) {
  return a.value();
}

代码示例来源:origin: jersey/jersey

@Override
public String getValueOf(QueryParam a) {
  return a.value();
}

代码示例来源:origin: com.sun.jersey/jersey-server

@Override
public String getValueOf(QueryParam a) {
  return a.value();
}

代码示例来源:origin: jersey/jersey

for (Annotation ann : paramAnns) {
  if (Objects.equals(ann.annotationType(), QueryParam.class)) {
    querySubString.append(((QueryParam) ann).value());
    querySubString.append(',');
      QueryParam queryParam = field.getAnnotation(QueryParam.class);
      if (queryParam != null) {
        querySubString.append(queryParam.value());
        querySubString.append(',');
      QueryParam queryParam = beanMethod.getAnnotation(QueryParam.class);
      if (queryParam != null) {
        querySubString.append(queryParam.value());
        querySubString.append(',');

代码示例来源:origin: dropwizard/dropwizard

/**
 * Derives member's name and type from it's annotations
 */
public static Optional<String> getParameterNameFromAnnotations(Annotation[] memberAnnotations) {
  for (Annotation a : memberAnnotations) {
    if (a instanceof QueryParam) {
      return Optional.of("query param " + ((QueryParam) a).value());
    } else if (a instanceof PathParam) {
      return Optional.of("path param " + ((PathParam) a).value());
    } else if (a instanceof HeaderParam) {
      return Optional.of("header " + ((HeaderParam) a).value());
    } else if (a instanceof CookieParam) {
      return Optional.of("cookie " + ((CookieParam) a).value());
    } else if (a instanceof FormParam) {
      return Optional.of("form field " + ((FormParam) a).value());
    } else if (a instanceof Context) {
      return Optional.of("context");
    } else if (a instanceof MatrixParam) {
      return Optional.of("matrix param " + ((MatrixParam) a).value());
    }
  }
  return Optional.empty();
}

代码示例来源:origin: jersey/jersey

} else if ((ann = anns.get((QueryParam.class))) != null) {
  if (value instanceof Collection) {
    newTarget = newTarget.queryParam(((QueryParam) ann).value(), convert((Collection) value));
  } else {
    newTarget = newTarget.queryParam(((QueryParam) ann).value(), value);

代码示例来源:origin: apache/servicecomb-java-chassis

@Override
 public String getAnnotationParameterName(Object annotation) {
  return ((QueryParam) annotation).value();
 }
}

代码示例来源:origin: swagger-api/swagger-core

Parameter qp = new Parameter();
  qp.setIn(QUERY_PARAM);
  qp.setName(param.value());
  parameter = qp;
} else if (annotation instanceof PathParam) {

代码示例来源:origin: org.glassfish.jersey.core/jersey-server

@Override
public String getValueOf(QueryParam a) {
  return a.value();
}

代码示例来源:origin: stackoverflow.com

if (!requestContext.getUriInfo().getQueryParameters().containsKey(queryAnnotation.value()))
  throw new YourCustomRuntimeException(queryAnnotation.value());

代码示例来源:origin: stackoverflow.com

requiredQueryParamsBuilder.add(queryParam.value());

代码示例来源:origin: apache/servicecomb-java-chassis

return ((QueryParam) annotation).value();

代码示例来源:origin: kongchen/swagger-maven-plugin

private QueryParameter extractQueryParam(Type type, String defaultValue, QueryParam param) {
  QueryParameter queryParameter = new QueryParameter().name(param.value());
  if (!Strings.isNullOrEmpty(defaultValue)) {
    queryParameter.setDefaultValue(defaultValue);
  }
  Property schema = ModelConverters.getInstance().readAsProperty(type);
  if (schema != null) {
    queryParameter.setProperty(schema);
  }
  String parameterType = queryParameter.getType();
  if (parameterType == null || parameterType.equals("ref")) {
    queryParameter.setType("string");
  }
  return queryParameter;
}

代码示例来源:origin: stackoverflow.com

public class QueryParamResolver implements HandlerMethodArgumentResolver {

  public boolean supportsParameter(MethodParameter parameter) {
    return parameter.getParameterAnnotation(QueryParam.class) != null;
  }

  public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest,
    WebDataBinderFactory binderFactory) throws Exception {
    QueryParam attr = parameter.getParameterAnnotation(QueryParam.class);
    // here you can use any logic which you need
    return webRequest.getParameter(attr.value());
  }
}

代码示例来源:origin: resteasy/Resteasy

parameter.paramName = queryParam.value();

代码示例来源:origin: wso2/msf4j

@SuppressWarnings("unchecked")
private Object getQueryParamValue(HttpResourceModel.ParameterInfo<List<String>> info, String uri) {
  QueryParam queryParam = info.getAnnotation();
  List<String> values = new QueryStringDecoderUtil(uri).parameters().get(queryParam.value());
  if (values == null || values.isEmpty()) {
    String defaultVal = info.getDefaultVal();
    if (defaultVal != null) {
      values = Collections.singletonList(defaultVal);
    }
  }
  return info.convert(values);
}

代码示例来源:origin: resteasy/Resteasy

.value());
} else if ((header = FindAnnotation.findAnnotation(annotations,
   HeaderParam.class)) != null)

代码示例来源:origin: resteasy/Resteasy

.value());
} else if ((headerParam = FindAnnotation.findAnnotation(annotations,
   HeaderParam.class)) != null) {

代码示例来源:origin: resteasy/Resteasy

return new QueryParamInjector(type, genericType, injectTarget, queryParam.value(), defaultVal, encode, annotations, providerFactory);

代码示例来源:origin: resteasy/Resteasy

processor = new QueryParamProcessor(query.value(), genericType, annotations, configuration);

相关文章