本文整理汇总了Java中com.thoughtworks.xstream.converters.SingleValueConverter.canConvert方法的典型用法代码示例。如果您正苦于以下问题:Java SingleValueConverter.canConvert方法的具体用法?Java SingleValueConverter.canConvert怎么用?Java SingleValueConverter.canConvert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thoughtworks.xstream.converters.SingleValueConverter
的用法示例。
在下文中一共展示了SingleValueConverter.canConvert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavaFieldConverter
import com.thoughtworks.xstream.converters.SingleValueConverter; //导入方法依赖的package包/类
/**
* Construct a JavaFieldConverter. Depending on the mapper chain the converter will also respect aliases.
*
* @param javaClassConverter the converter to use
* @param mapper to use
* @since 1.4.5
*/
protected JavaFieldConverter(final SingleValueConverter javaClassConverter, final Mapper mapper) {
if (!javaClassConverter.canConvert(Class.class)) {
throw new InitializationException("Java Class Converter cannot handle Class types");
}
this.javaClassConverter = javaClassConverter;
this.mapper = mapper;
}
示例2: JavaMethodConverter
import com.thoughtworks.xstream.converters.SingleValueConverter; //导入方法依赖的package包/类
/**
* Construct a JavaMethodConverter.
*
* @param javaClassConverter the converter to use
* @since 1.4.5
*/
protected JavaMethodConverter(final SingleValueConverter javaClassConverter) {
if (!javaClassConverter.canConvert(Class.class)) {
throw new InitializationException("Java Class Converter cannot handle Class types");
}
this.javaClassConverter = javaClassConverter;
}