public T readFrom(Class<T> type, Type genType, Annotation[] anns, MediaType mt, MultivaluedMap<String, String> headers, InputStream is) throws IOException { String string = IOUtils.toString(is, HttpUtils.getEncoding(mt, "UTF-8")); if (type == Character.class) { char character = StringUtils.isEmpty(string) ? ' ' : string.charAt(0); return type.cast(Character.valueOf(character)); } return InjectionUtils.handleParameter( string, false, type, anns, ParameterType.REQUEST_BODY, null); }
public T readFrom(Class<T> type, Type genType, Annotation[] anns, MediaType mt, MultivaluedMap<String, String> headers, InputStream is) throws IOException { String string = IOUtils.toString(is, HttpUtils.getEncoding(mt, StandardCharsets.UTF_8.name())); if (StringUtils.isEmpty(string)) { reportEmptyContentLength(); } if (type == Character.class) { char character = string.charAt(0); return type.cast(Character.valueOf(character)); } return InjectionUtils.handleParameter( string, false, type, genType, anns, ParameterType.REQUEST_BODY, null); }
private static Object processCookieParam(Message m, String cookieName, Class<?> pClass, Type genericType, Annotation[] paramAnns, String defaultValue) { Cookie c = new HttpHeadersImpl(m).getCookies().get(cookieName); if (c == null && defaultValue != null) { c = Cookie.valueOf(cookieName + '=' + defaultValue); } if (c == null) { return null; } if (pClass.isAssignableFrom(Cookie.class)) { return c; } return InjectionUtils.handleParameter(c.getValue(), false, pClass, paramAnns, ParameterType.COOKIE, m); }
List<String> valuesList = processedValuesEntry.getValue(); for (String value : valuesList) { Object o = InjectionUtils.handleParameter(value, decoded, valueType, valueType, paramAnns, pathParam, message); theValues.add(convertStringToPrimitive(processedValuesEntry.getKey(), keyType), o); List<String> valuesList = processedValuesEntry.getValue(); for (String value : valuesList) { Object o = InjectionUtils.handleParameter(value, decoded, valueType, valueType, paramAnns, pathParam, message); theValues.put(
List<String> valuesList = processedValuesEntry.getValue(); for (String value : valuesList) { Object o = InjectionUtils.handleParameter(value, decoded, valueType, paramAnns, pathParam, message); theValues.add(convertStringToPrimitive(processedValuesEntry.getKey(), keyType), o); List<String> valuesList = processedValuesEntry.getValue(); for (String value : valuesList) { Object o = InjectionUtils.handleParameter(value, decoded, valueType, paramAnns, pathParam, message); theValues.put(
value = InjectionUtils.handleParameter(result, decoded, paramType, genericType, paramAnns, pathParam, message);
value = InjectionUtils.handleParameter(result, decoded, paramType, paramAnns, pathParam, message);
valuesList = checkPathSegment(valuesList, realType, pathParam); for (int ind = 0; ind < valuesList.size(); ind++) { Object o = InjectionUtils.handleParameter(valuesList.get(ind), decoded, realType, paramAnns, pathParam, message); addToCollectionValues(theValues, o, ind);
pType, message, decoded); } else { paramValue = InjectionUtils.handleParameter( processedValues.values().iterator().next().get(0), decoded, type, type, paramAnns, pType, message);
valuesList = checkPathSegment(valuesList, realType, pathParam); for (int ind = 0; ind < valuesList.size(); ind++) { Object o = InjectionUtils.handleParameter(valuesList.get(ind), decoded, realType, realGenericType, paramAnns, pathParam, message); addToCollectionValues(theValues, o, ind);
pType, message, decoded); } else { paramValue = InjectionUtils.handleParameter( processedValues.values().iterator().next().get(0), decoded, type, paramAnns, pType, message);