String defaultVal = null;
if (defaultValue != null) defaultVal = defaultValue.value();
QueryParam query;
HeaderParam header;
MatrixParam matrix;
PathParam uriParam;
CookieParam cookie;
FormParam formParam;
Form form;
Suspend suspend;
Suspended suspended;
if ((query = findAnnotation(annotations, QueryParam.class)) != null)
{
return new QueryParamInjector(type, genericType, injectTarget, query.value(), defaultVal, encode, annotations, providerFactory);
}
else if ((header = findAnnotation(annotations, HeaderParam.class)) != null)
{
return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, annotations, providerFactory);
}
else if ((formParam = findAnnotation(annotations, FormParam.class)) != null)
{
return new FormParamInjector(type, genericType, injectTarget, formParam.value(), defaultVal, encode, annotations, providerFactory);
}
else if ((cookie = findAnnotation(annotations, CookieParam.class)) != null)
{
return new CookieParamInjector(type, genericType, injectTarget, cookie.value(), defaultVal, annotations, providerFactory);
}
else if ((uriParam = findAnnotation(annotations, PathParam.class)) != null)
{
return new PathParamInjector(type, genericType, injectTarget, uriParam.value(), defaultVal, encode, annotations, providerFactory);
}
else if ((form = findAnnotation(annotations, Form.class)) != null)
{
String prefix = form.prefix();
if (prefix.length() > 0)
{
if (genericType instanceof ParameterizedType)
{
ParameterizedType pType = (ParameterizedType) genericType;
if (Types.isA(List.class, pType))
{
return new ListFormInjector(type, Types.getArgumentType(pType, 0), prefix, providerFactory);
}
if (Types.isA(Map.class, pType))
{
return new MapFormInjector(type, Types.getArgumentType(pType, 0), Types.getArgumentType(pType, 1), prefix, providerFactory);
}
}
return new PrefixedFormInjector(type, prefix, providerFactory);
}
return new FormInjector(type, providerFactory);
}
else if (findAnnotation(annotations, BeanParam.class) != null)
{
return new FormInjector(type, providerFactory);
}
else if ((matrix = findAnnotation(annotations, MatrixParam.class)) != null)
{
return new MatrixParamInjector(type, genericType, injectTarget, matrix.value(), defaultVal, encode, annotations, providerFactory);
}
else if ((suspend = findAnnotation(annotations, Suspend.class)) != null)
{
return new SuspendInjector(suspend.value(), type);
}