Java 类com.beust.jcommander.IStringConverter 实例源码

项目:SVG-Plott    文件:SvgPlotOptions.java   
@SuppressWarnings({ "unchecked", "rawtypes" })
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
    if (forType.equals(Point.class))
        return Point.Converter.class;
    else if (forType.equals(Range.class))
        return Range.Converter.class;
    else if (forType.equals(Function.class))
        return Function.Converter.class;
    else if (forType.equals(PointListList.class))
        return PointListList.Converter.class;
    else if (forType.equals(IntegralPlotSettings.class))
        return IntegralPlotSettings.Converter.class;
    else if (forType.equals(CsvOrientation.class))
        return CsvOrientation.CsvOrientationConverter.class;
    else if (forType.equals(CsvType.class))
        return CsvType.CsvTypeConverter.class;
    else if (forType.equals(DiagramType.class))
        return DiagramType.DiagramTypeConverter.class;
    else if (forType.equals(BarAccumulationStyle.class))
        return BarAccumulationStyle.BarAccumulationStyleConverter.class;
    else if (forType.equals(SortingType.class))
        return SortingType.SortingTypeConverter.class;
    else
        return null;
}
项目:mux2fs    文件:CommandLineArguments.java   
@Override
public IStringConverter<?> getConverterInstance(Parameter parameter, Class<?> forType, String optionName) {
    if (Path.class.equals(forType)) {
        return new CustomPathConverter();
    }
    return null;
}
项目:nomulus    文件:ParameterFactory.java   
/** Returns JCommander converter for a given type, or {@code null} if none exists. */
@Nullable
@Override
@SuppressWarnings("unchecked")
public <T> Class<? extends IStringConverter<T>> getConverter(@Nullable Class<T> type) {
  return (Class<? extends IStringConverter<T>>) CONVERTERS.get(type);
}
项目:jsflight    文件:PropertiesConfig.java   
private <T> T getProperty(String name, T defaultValue, IParameterValidator validator, IStringConverter<T> converter)
{
    String value = properties.getProperty(name);
    if (value == null && defaultValue != null)
    {
        value = defaultValue.toString();
    }
    if (validator != null)
    {
        validator.validate(name, value);
    }
    return value == null ? null : converter.convert(value);
}
项目:digdag    文件:IdConverterFactory.java   
@Override
@SuppressWarnings("unchecked")
public <T> Class<? extends IStringConverter<T>> getConverter(Class<T> forType)
{
    if (forType.equals(Id.class)) {
        return (Class<IStringConverter<T>>) (Class<?>) IdConverter.class;
    }
    return null;
}
项目:JDriverStation    文件:LevelConverterFactory.java   
@Override
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
    if (forType.equals(Level.class)) {
        return LevelConverter.class;
    } else {
        return null;
    }
}
项目:morfologik-stemming    文件:CustomParameterConverters.java   
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public <T> Class<? extends IStringConverter<T>> getConverter(Class<T> forType) {
  if (forType.equals(Path.class)) {
    return (Class) PathConverter.class;
  }
  return null;
}
项目:ttc2017smartGrids    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return classConverters.get(forType);
}
项目:ttc2017smartGrids    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return classConverters.get(forType);
}
项目:jcommander-addons    文件:AbstractStringConverterBasicTest.java   
public AbstractStringConverterBasicTest(final IStringConverter<T> stringConverter) {
    super(stringConverter);
}
项目:jcommander-addons    文件:AbstractStringConverterTestWrapper.java   
public AbstractStringConverterTestWrapper(final IStringConverter<T> stringConverter) {
    this.stringConverter = stringConverter;
}
项目:jcommander-addons    文件:AbstractStringConverterTestWrapper.java   
public IStringConverter<T> getStringConverter() {
    return stringConverter;
}
项目:muJava    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:jsflight    文件:PropertiesConfig.java   
private String getProperty(String name, IParameterValidator validator)
{
    return getProperty(name, validator, (IStringConverter<String>)String::toString);
}
项目:jsflight    文件:PropertiesConfig.java   
private <T> T getProperty(String name, IParameterValidator validator, IStringConverter<T> converter)
{
    return getProperty(name, null, validator, converter);
}
项目:jsflight    文件:PropertiesConfig.java   
private <T> T getProperty(String name, T defaultValue, IStringConverter<T> converter)
{
    return getProperty(name, defaultValue, null, converter);
}
项目:jsflight    文件:PropertiesConfig.java   
@Override
public Integer getProxyPort()
{
    return getProperty(PropertiesConstants.PROXY_PORT, POSITIVE_INTEGER, (IStringConverter<Integer>)Integer::new);
}
项目:VarJ    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:SPA    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:SPA    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:Corporatique    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
    return m_classConverters.get(forType);
}
项目:java_seqbuster    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:java_seqbuster    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:java_seqbuster    文件:DefaultConverterFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  return m_classConverters.get(forType);
}
项目:Scribengin    文件:CustomConvertFactory.java   
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
  if (forType.equals(HostPort.class)) {
    return HostPortConverter.class;
  } else
    return null;
}
项目:sparc    文件:DefaultConverterFactory.java   
@SuppressWarnings("unchecked")
public Class<? extends IStringConverter<?>> getConverter(@SuppressWarnings("rawtypes") Class forType) {
    return m_classConverters.get(forType);
  }
项目:WAG    文件:StringConverterFactory.java   
@Override
public <T> Class<? extends IStringConverter<T>> getConverter(Class<T> forType) {
    if (converts.containsKey(forType))
        return (Class<IStringConverter<T>>) converts.get(forType);
    return null;
}
项目:WAG    文件:StringConverterFactory.java   
public <T> void register(final Class<T> type,
                         final Class<? extends IStringConverter<? extends T>> converter) {
    converts.put(type, converter);
}
项目:ttc2017smartGrids    文件:DefaultListConverter.java   
/**
 * Constructs a new converter.
 * @param splitter to split value into list of arguments
 * @param converter to convert list of arguments to target element type
 */
public DefaultListConverter(IParameterSplitter splitter, IStringConverter<T> converter) {
  this.splitter = splitter;
  this.converter = converter;
}
项目:ttc2017smartGrids    文件:DefaultListConverter.java   
/**
 * Constructs a new converter.
 * @param splitter to split value into list of arguments
 * @param converter to convert list of arguments to target element type
 */
public DefaultListConverter(IParameterSplitter splitter, IStringConverter<T> converter) {
  this.splitter = splitter;
  this.converter = converter;
}