/** * Returs the commandline for the given object. If the object is not * derived from AbstractOptionHandler, then only the classname. Otherwise * the classname and the options are returned. * * @param obj the object to generate the commandline for * @return the commandline */ public static String toCommandLine(MOAObject obj) { String result = obj.getClass().getName(); if (obj instanceof AbstractOptionHandler) result += " " + ((AbstractOptionHandler) obj).getOptions().getAsCLIString(); return result.trim(); } }
@Override public String getCLICreationString(Class<?> expectedType) { return ClassOption.stripPackagePrefix(this.getClass().getName(), expectedType) + " " + getOptions().getAsCLIString(); }
@Override public String getCLICreationString(Class<?> expectedType) { return ClassOption.stripPackagePrefix(this.getClass().getName(), expectedType) + " " + getOptions().getAsCLIString(); }
@Override public String getCLICreationString(Class<?> expectedType) { return ClassOption.stripPackagePrefix(this.getClass().getName(), expectedType) + " " + getOptions().getAsCLIString(); }
@Override public String getCLICreationString(Class<?> expectedType) { return ClassOption.stripPackagePrefix(this.getClass().getName(), expectedType) + " " + getOptions().getAsCLIString(); }
@Override public String getCLICreationString(Class<?> expectedType) { return ClassOption.stripPackagePrefix(this.getClass().getName(), expectedType) + " " + getOptions().getAsCLIString(); }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof OptionHandler) { String subOptions = ((OptionHandler) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof Configurable) { //String subOptions = ((Configurable) obj).getOptions().getAsCLIString(); //Add cli parser JavaCLIParser config = new JavaCLIParser(obj, ""); String subOptions = config.getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }
public static String objectToCLIString(Object obj, Class<?> requiredType) { if (obj == null) { return ""; } if (obj instanceof File) { return (FILE_PREFIX_STRING + ((File) obj).getPath()); } if (obj instanceof String) { return (INMEM_PREFIX_STRING + obj); } String className = classToCLIString(obj.getClass(), requiredType); if (obj instanceof Configurable) { //Add cli parser JavaCLIParser config = new JavaCLIParser(obj, ""); String subOptions = config.getOptions().getAsCLIString(); //String subOptions = ((Configurable) obj).getOptions().getAsCLIString(); if (subOptions.length() > 0) { return (className + " " + subOptions); } } return className; }