IntrospectionSupport.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:Camel 作者:
private static Object convert(TypeConverter typeConverter, Class<?> type, Object value)
    throws URISyntaxException, NoTypeConversionAvailableException {
    if (typeConverter != null) {
        return typeConverter.mandatoryConvertTo(type, value);
    }
    if (type == URI.class) {
        return new URI(value.toString());
    }
    PropertyEditor editor = PropertyEditorManager.findEditor(type);
    if (editor != null) {
        // property editor is not thread safe, so we need to lock
        Object answer;
        synchronized (LOCK) {
            editor.setAsText(value.toString());
            answer = editor.getValue();
        }
        return answer;
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号