Java 类com.beust.jcommander.validators.NoValueValidator 实例源码

项目:ttc2017smartGrids    文件:ParameterDescription.java   
public static void validateValueParameter(Class<? extends IValueValidator> validator,
    String name, Object value) {
  try {
    if (validator != NoValueValidator.class) {
      p("Validating value parameter:" + name + " value:" + value + " validator:" + validator);
    }
    validator.newInstance().validate(name, value);
  } catch (InstantiationException | IllegalAccessException e) {
    throw new ParameterException("Can't instantiate validator:" + e);
  }
}
项目:ttc2017smartGrids    文件:ParameterDescription.java   
public static void validateValueParameter(Class<? extends IValueValidator> validator,
    String name, Object value) {
  try {
    if (validator != NoValueValidator.class) {
      p("Validating value parameter:" + name + " value:" + value + " validator:" + validator);
    }
    validator.newInstance().validate(name, value);
  } catch (InstantiationException | IllegalAccessException e) {
    throw new ParameterException("Can't instantiate validator:" + e);
  }
}