public static Object createObject(String cliString, Class<?> requiredType) throws Exception { return cliStringToObject(cliString, requiredType, null); }
public static <T> T createObject(String cliString, Class<T> requiredType) throws Exception { return cliStringToObject(cliString, requiredType, null); }
public static Object createObject(String[] args, Class<?> requiredType) throws Exception { // build a single string by concatenating cli options StringBuilder cliString = new StringBuilder(); for (int i = 0; i < args.length; i++) { cliString.append(" ").append(args[i]); } return cliStringToObject(cliString.toString(), requiredType, null); }
public static <T> T createObject(String[] args, Class<T> requiredType) throws Exception { // build a single string by concatenating cli options StringBuilder cliString = new StringBuilder(); for (int i = 0; i < args.length; i++) { cliString.append(" ").append(args[i]); } return cliStringToObject(cliString.toString(), requiredType, null); }
@Override public void setValueViaCLIString(String s) { if ((this.nullString != null) && ((s == null) || (s.length() == 0) || s.equals(this.nullString))) { this.currentValue = null; } else { try { this.currentValue = cliStringToObject(s, this.requiredType, null); } catch (Exception e) { throw new IllegalArgumentException("Problems with option: " + getName(), e); } } }
@Override public void setValueViaCLIString(String s) { if ((this.nullString != null) && ((s == null) || (s.length() == 0) || s.equals(this.nullString))) { this.currentValue = null; } else { try { this.currentValue = cliStringToObject(s, this.requiredType, null); } catch (Exception e) { throw new IllegalArgumentException("Problems with option: " + getName(), e); } } }
task = ClassOption.cliStringToObject(cliString.toString(), Task.class, extraOptions); logger.info("Successfully instantiating {}", task.getClass().getCanonicalName()); } catch (Exception e) {
task = ClassOption.cliStringToObject(cliString.toString(), Task.class, extraOptions); logger.info("Successfully instantiating {}", task.getClass().getCanonicalName()); } catch (Exception e) {