本文整理匯總了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;
}