@Override public String getValueOf(HeaderParam a) { return a.value(); }
@Override public String getValueOf(HeaderParam a) { return a.value(); }
@Override public String getValueOf(HeaderParam a) { return a.value(); }
/** * 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(); }
@Override public String getAnnotationParameterName(Object annotation) { return ((HeaderParam) annotation).value(); } }
Parameter pp = new Parameter(); pp.setIn(HEADER_PARAM); pp.setName(param.value()); parameter = pp; } else if (annotation instanceof CookieParam) {
@Override public String getValueOf(HeaderParam a) { return a.value(); }
public Object extractEntity(ClientContext context, Object... args) { return context.getClientResponse().getHeaderString(headerParam.value()); } };
return ((HeaderParam) annotation).value();
private HeaderParameter extractHeaderParam(Type type, String defaultValue, HeaderParam param) { HeaderParameter headerParameter = new HeaderParameter().name(param.value()); if (!Strings.isNullOrEmpty(defaultValue)) { headerParameter.setDefaultValue(defaultValue); } Property schema = ModelConverters.getInstance().readAsProperty(type); if (schema != null) { headerParameter.setProperty(schema); } String parameterType = headerParameter.getType(); if (parameterType == null || parameterType.equals("ref") || parameterType.equals("array")) { headerParameter.setType("string"); } return headerParameter; }
@Override public String getAnnotationParameterName(Object annotation) { return ((HeaderParam) annotation).value(); } }
parameter.paramName = header.value();
public Object extractEntity(ClientContext context, Object... args) { return context.getClientResponse().getHeaderString(headerParam.value()); } };
header.value()); } else if ((cookie = FindAnnotation.findAnnotation(annotations, CookieParam.class)) != null)
HeaderParam.class)) != null) { addParameter(type, annotations, ResteasyWadlMethodParamMetaData.MethodParamType.HEADER_PARAMETER, headerParam.value()); } else if ((cookieParam = FindAnnotation.findAnnotation(annotations, CookieParam.class)) != null) {
return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, annotations, providerFactory);
HeaderParam.class)) != null) processor = new HeaderParamProcessor(header.value(), genericType, annotations, configuration);
private Multimap<String, String> buildHeaders(Multimap<String, ?> tokenValues, Invocation invocation) { Multimap<String, String> headers = LinkedHashMultimap.create(); addHeaderIfAnnotationPresentOnMethod(headers, invocation, tokenValues); for (Parameter headerParam : parametersWithAnnotation(invocation.getInvokable(), HeaderParam.class)) { Annotation key = headerParam.getAnnotation(HeaderParam.class); String value = invocation.getArgs().get(headerParam.hashCode()).toString(); value = replaceTokens(value, tokenValues); headers.put(((HeaderParam) key).value(), value); } addProducesIfPresentOnTypeOrMethod(headers, invocation); addConsumesIfPresentOnTypeOrMethod(headers, invocation); return headers; }
private static Header getHeader(TypeInfo typeInfo, String defaultValue, HeaderParam headerParam) { Header header = new Header(); header.setName(headerParam.value()); header.setType(typeInfo.getRepresentationName()); header.setAllowMultiple(typeInfo.isList()); header.setRequired(false); header.setDescription(StringUtils.isNullOrEmpty(defaultValue) ? "" : "Value: " + defaultValue); header.setDefaultValue(defaultValue); return header; }