private static Object evaluateFactoryMethods(String value, ParameterType pType, Object result,
Class<?> cls, String[] methodNames) {
Exception factoryMethodEx = null;
for (String mName : methodNames) {
try {
result = evaluateFactoryMethod(value, cls, pType, mName);
if (result != null) {
factoryMethodEx = null;
break;
}
} catch (Exception ex) {
factoryMethodEx = ex;
if (!cls.isEnum() || !"fromValue".equals(mName)) {
break;
}
}
}
if (factoryMethodEx != null) {
Throwable t = getOrThrowActualException(factoryMethodEx);
LOG.warning(new org.apache.cxf.common.i18n.Message("CLASS_VALUE_OF_FAILURE",
BUNDLE,
cls.getName()).toString());
throw new WebApplicationException(t, HttpUtils.getParameterFailureStatus(pType));
}
return result;
}