@Override public Object decode(String value) throws Exception { if (value == null) { throw new IllegalArgumentException("Unable to look up enum value from null"); } Method valueOf = getType().getMethod("valueOf", String.class); try { return valueOf.invoke(null, value); } catch (IllegalAccessException e) { // means we can't have access to the enum, fall back to literal return new LiteralPPIO(getType()).decode(value); } catch (Exception e) { // try upper case try { return valueOf.invoke(null, value.toUpperCase()); } catch (Exception e1) { // try lower case try { return valueOf.invoke(null, value.toLowerCase()); } catch (Exception e2) { // give up and throw back first exception throw e; } } } }
public static ProcessParameterIO find(Parameter<?> p, ApplicationContext context, String mime) { return new LiteralPPIO(p.type);
result.add(new LiteralPPIO(p.type)); return result;
LOGGER.log(Level.FINE, "Trying to find the PPIO for the Enum = " + p.type); return new LiteralPPIO(p.type);