本文整理汇总了Java中com.beust.jcommander.IStringConverter类的典型用法代码示例。如果您正苦于以下问题:Java IStringConverter类的具体用法?Java IStringConverter怎么用?Java IStringConverter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IStringConverter类属于com.beust.jcommander包,在下文中一共展示了IStringConverter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@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;
}
示例2: getConverterInstance
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@Override
public IStringConverter<?> getConverterInstance(Parameter parameter, Class<?> forType, String optionName) {
if (Path.class.equals(forType)) {
return new CustomPathConverter();
}
return null;
}
示例3: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
/** 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);
}
示例4: getProperty
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
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);
}
示例5: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@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;
}
示例6: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@Override
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
if (forType.equals(Level.class)) {
return LevelConverter.class;
} else {
return null;
}
}
示例7: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@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;
}
示例8: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
return classConverters.get(forType);
}
示例9: AbstractStringConverterBasicTest
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public AbstractStringConverterBasicTest(final IStringConverter<T> stringConverter) {
super(stringConverter);
}
示例10: AbstractStringConverterTestWrapper
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public AbstractStringConverterTestWrapper(final IStringConverter<T> stringConverter) {
this.stringConverter = stringConverter;
}
示例11: getStringConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public IStringConverter<T> getStringConverter() {
return stringConverter;
}
示例12: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
return m_classConverters.get(forType);
}
示例13: getProxyPort
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
@Override
public Integer getProxyPort()
{
return getProperty(PropertiesConstants.PROXY_PORT, POSITIVE_INTEGER, (IStringConverter<Integer>)Integer::new);
}
示例14: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
return m_classConverters.get(forType);
}
示例15: getConverter
import com.beust.jcommander.IStringConverter; //导入依赖的package包/类
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
if (forType.equals(HostPort.class)) {
return HostPortConverter.class;
} else
return null;
}