{
return constructor.newInstance(strVal);
}
catch (InstantiationException e)
{
throw new BadRequestException("Unable to extract parameter from http request for " + getParamSignature() + " value is '" + strVal + "'" + " for " + target, e);
}
catch (IllegalAccessException e)
{
throw new BadRequestException("Unable to extract parameter from http request: " + getParamSignature() + " value is '" + strVal + "'" + " for " + target, e);
}
catch (InvocationTargetException e)
{
throw new BadRequestException("Unable to extract parameter from http request: " + getParamSignature() + " value is '" + strVal + "'" + " for " + target, e);
}
}
else if (valueOf != null)
{
try
{
return valueOf.invoke(null, strVal);
}
catch (IllegalAccessException e)
{
throw new BadRequestException("Unable to extract parameter from http request: " + getParamSignature() + " value is '" + strVal + "'" + " for " + target, e);
}
catch (InvocationTargetException e)
{
throw new BadRequestException("Unable to extract parameter from http request: " + getParamSignature() + " value is '" + strVal + "'" + " for " + target, e.getTargetException());
}
}
return null;
}