use of org.eclipse.jnosql.mapping.graph.GraphConfiguration in project jnosql-diana by eclipse.
the class GraphConverter method success.
@Override
protected Graph success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
final String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (GraphConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final GraphConfiguration configuration = (GraphConfiguration) reflections.newInstance(configurationClass);
return configuration.apply(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + GraphConfiguration.class);
}
Aggregations