}
String value = null;
HttpHeaders httpHeaders = runtimeContext.getHttpHeaders();
Map<String, Cookie> values = httpHeaders.getCookies();
Cookie cookie = null;
if (values.size() > 0) {
cookie = values.get(getName());
}
if (cookie == null && hasDefaultValue()) {
cookie = new Cookie(getName(), getDefaultValue());
}
if (cookie != null) {
// special handling for List<Cookie>
if (isTypeCollectionOf(Cookie.class)) {
return elementAsTypeCollection(cookie, new CookieComparator());
}
// special handling for Cookie
if (isTypeOf(Cookie.class)) {
return cookie;
}
// for all other types
value = cookie.getValue();
}
try {
return getConvertor().convert(value);
} catch (ConversionException e) {