// For path, query & matrix parameters this is 404,
// for others 400...
//
if (pType == ParameterType.PATH || pType == ParameterType.QUERY
|| pType == ParameterType.MATRIX) {
throw new WebApplicationException(nfe, Response.Status.NOT_FOUND);
}
throw new WebApplicationException(nfe, Response.Status.BAD_REQUEST);
}
}
boolean adapterHasToBeUsed = false;
Class<?> cls = pClass;
Class<?> valueType = JAXBUtils.getValueTypeFromAdapter(pClass, pClass, paramAnns);
if (valueType != cls) {
cls = valueType;
adapterHasToBeUsed = true;
}
Object result = instantiateFromParameterHandler(value, cls, message);
if (result != null) {
return result;
}
// check constructors accepting a single String value
try {
Constructor<?> c = cls.getConstructor(new Class<?>[]{String.class});
result = c.newInstance(new Object[]{value});
} catch (NoSuchMethodException ex) {
// try valueOf
} catch (WebApplicationException ex) {
throw ex;
} catch (Exception ex) {
result = createFromParameterHandler(value, cls, message);
if (result == null) {
LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
BUNDLE,
pClass.getName()).toString());
throw new WebApplicationException(ex, HttpUtils.getParameterFailureStatus(pType));
}
}
if (result == null) {
// check for valueOf(String) static methods
String[] methodNames = cls.isEnum()