private Converter loadConverter()

in rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java [231:258]


    private Converter loadConverter(String converterName, Type type) {
        if (converterName != null) {

            try {
                Class converterClazz = Class.forName(converterName, true, 
                        Thread.currentThread().getContextClassLoader());
                if (null != converterClazz) {
                    return (Converter) converterClazz.newInstance();
                }

                converterClazz = Class.forName(converterName);
                if (converterClazz != null) {
                    return (Converter) converterClazz.newInstance();
                }
            } catch (ClassNotFoundException ex) {
                throw new RuntimeException(ex);
            } catch (IllegalAccessException ex) {
                throw new RuntimeException(ex);
            } catch (InstantiationException ex) {
                throw new RuntimeException(ex);
            }
        }
        if (SDODataTypes.BYTES.getName().equals(type.getName()) && SDODataTypes.BYTES.getURI().equals(type.getURI())) {
            return new DefaultConverter();
        } else {
        	return null;
        }
    }