/** * Tests if the arguments are correct or incorrect. * * @param args command line arguments * @param argProxyInterface interface with parameters description * @return null, if arguments are valid or error message otherwise */ public static String validateArgumentsLoudly(String[] args, Class<?> argProxyInterface) { return validateArgumentsLoudly(args, new Class[]{argProxyInterface}); }
/** * Tests if the argument are correct or incorrect. Incorrect means, that mandatory arguments are missing or * there are unknown arguments. The argument value itself can also be incorrect, but this * is checked by the {@link ArgumentParser#parse(String[], Class)} method and reported accordingly. * * @param args command line arguments * @param argProxyInterfaces interfaces with parameters description * @return true, if arguments are valid */ public static boolean validateArguments(String[] args, Class<?>... argProxyInterfaces) { return null == validateArgumentsLoudly(args, argProxyInterfaces); }
protected <T> T validateAndParseParams(String[] args, Class<T> argProxyInterface) { String errorMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + getHelp()); } return ArgumentParser.parse(args, argProxyInterface); }
/** * Validates arguments for a format processed by the <code>factory</code>. * @param factory a stream factory * @param args arguments */ protected void validateFactoryArgs(ObjectStreamFactory<T> factory, String[] args) { String errMessage = ArgumentParser.validateArgumentsLoudly(args, factory.getParameters()); if (null != errMessage) { throw new TerminateToolException(1, "Format parameters are invalid: " + errMessage + "\n" + "Usage: " + ArgumentParser.createUsage(factory.getParameters())); } }
String errorMessage = ArgumentParser.validateArgumentsLoudly(formatArgs, streamFactory.getParameters()); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + helpString);
/** * Validates arguments using parameters from <code>argProxyInterface</code> and the parameters of the * <code>format</code>. * * @param args arguments * @param argProxyInterface interface with parameter descriptions * @param format data format name * @param <A> A */ @SuppressWarnings({"unchecked"}) protected <A> void validateAllArgs(String[] args, Class<A> argProxyInterface, String format) { ObjectStreamFactory<T> factory = getStreamFactory(format); String errMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface, factory.<A>getParameters()); if (null != errMessage) { throw new TerminateToolException(1, errMessage + "\n" + getHelp(format)); } }
/** * Tests if the argument are correct or incorrect. Incorrect means, that mandatory arguments are missing or * there are unknown arguments. The argument value itself can also be incorrect, but this * is checked by the {@link ArgumentParser#parse(String[], Class)} method and reported accordingly. * * @param args command line arguments * @param argProxyInterfaces interfaces with parameters description * @return true, if arguments are valid */ public static boolean validateArguments(String[] args, Class<?>... argProxyInterfaces) { return null == validateArgumentsLoudly(args, argProxyInterfaces); }
/** * Tests if the argument are correct or incorrect. Incorrect means, that mandatory arguments are missing or * there are unknown arguments. The argument value itself can also be incorrect, but this * is checked by the {@link ArgumentParser#parse(String[], Class)} method and reported accordingly. * * @param args command line arguments * @param argProxyInterfaces interfaces with parameters description * @return true, if arguments are valid */ public static boolean validateArguments(String[] args, Class<?>... argProxyInterfaces) { return null == validateArgumentsLoudly(args, argProxyInterfaces); }
/** * Tests if the arguments are correct or incorrect. * * @param args command line arguments * @param argProxyInterface interface with parameters description * @return null, if arguments are valid or error message otherwise */ public static String validateArgumentsLoudly(String[] args, Class<?> argProxyInterface) { return validateArgumentsLoudly(args, new Class[]{argProxyInterface}); }
/** * Tests if the arguments are correct or incorrect. * * @param args command line arguments * @param argProxyInterface interface with parameters description * @return null, if arguments are valid or error message otherwise */ public static String validateArgumentsLoudly(String[] args, Class<?> argProxyInterface) { return validateArgumentsLoudly(args, new Class[]{argProxyInterface}); }
public String validateArguments(String[] args) { return ArgumentParser.validateArgumentsLoudly(args, Parameters.class); }
public String validateArguments(String[] args) { return ArgumentParser.validateArgumentsLoudly(args, Parameters.class); }
protected <T> T validateAndParseParams(String[] args, Class<T> argProxyInterface) { String errorMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + getHelp()); } return ArgumentParser.parse(args, argProxyInterface); }
protected <T> T validateAndParseParams(String[] args, Class<T> argProxyInterface) { String errorMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + getHelp()); } return ArgumentParser.parse(args, argProxyInterface); }
/** * Validates arguments for a format processed by the <code>factory</code>. * @param factory a stream factory * @param args arguments */ protected void validateFactoryArgs(ObjectStreamFactory<T> factory, String[] args) { String errMessage = ArgumentParser.validateArgumentsLoudly(args, factory.getParameters()); if (null != errMessage) { throw new TerminateToolException(1, "Format parameters are invalid: " + errMessage + "\n" + "Usage: " + ArgumentParser.createUsage(factory.getParameters())); } }
String errorMessage = ArgumentParser.validateArgumentsLoudly(formatArgs, streamFactory.getParameters()); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + helpString);
/** * Validates arguments for a format processed by the <code>factory</code>. * @param factory a stream factory * @param args arguments */ protected void validateFactoryArgs(ObjectStreamFactory<T> factory, String[] args) { String errMessage = ArgumentParser.validateArgumentsLoudly(args, factory.getParameters()); if (null != errMessage) { throw new TerminateToolException(1, "Format parameters are invalid: " + errMessage + "\n" + "Usage: " + ArgumentParser.createUsage(factory.getParameters())); } }
String errorMessage = ArgumentParser.validateArgumentsLoudly(formatArgs, streamFactory.getParameters()); if (null != errorMessage) { throw new TerminateToolException(1, errorMessage + "\n" + helpString);
/** * Validates arguments using parameters from <code>argProxyInterface</code> and the parameters of the * <code>format</code>. * * @param args arguments * @param argProxyInterface interface with parameter descriptions * @param format data format name * @param <A> A */ @SuppressWarnings({"unchecked"}) protected <A> void validateAllArgs(String[] args, Class<A> argProxyInterface, String format) { ObjectStreamFactory<T> factory = getStreamFactory(format); String errMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface, factory.<A>getParameters()); if (null != errMessage) { throw new TerminateToolException(1, errMessage + "\n" + getHelp(format)); } }
/** * Validates arguments using parameters from <code>argProxyInterface</code> and the parameters of the * <code>format</code>. * * @param args arguments * @param argProxyInterface interface with parameter descriptions * @param format data format name * @param <A> A */ @SuppressWarnings({"unchecked"}) protected <A> void validateAllArgs(String[] args, Class<A> argProxyInterface, String format) { ObjectStreamFactory<T> factory = getStreamFactory(format); String errMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface, factory.<A>getParameters()); if (null != errMessage) { throw new TerminateToolException(1, errMessage + "\n" + getHelp(format)); } }