use of org.eclipse.jnosql.mapping.reflection.Reflections in project jnosql-diana by eclipse.
the class DocumentCollectionManagerFactoryConverter method success.
@Override
public DocumentCollectionManagerFactory success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (DocumentConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final DocumentConfiguration configuration = (DocumentConfiguration) reflections.newInstance(configurationClass);
return configuration.get(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + DocumentConfiguration.class);
}
use of org.eclipse.jnosql.mapping.reflection.Reflections 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);
}
use of org.eclipse.jnosql.mapping.reflection.Reflections in project jnosql-diana by eclipse.
the class BucketManagerFactoryConverter method success.
@Override
public BucketManagerFactory success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (KeyValueConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final KeyValueConfiguration configuration = (KeyValueConfiguration) reflections.newInstance(configurationClass);
return configuration.get(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + KeyValueConfiguration.class);
}
use of org.eclipse.jnosql.mapping.reflection.Reflections in project jnosql-diana by eclipse.
the class ColumnFamilyManagerFactoryConverter method success.
@Override
public ColumnFamilyManagerFactory success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (ColumnConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final ColumnConfiguration configuration = (ColumnConfiguration) reflections.newInstance(configurationClass);
return configuration.get(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + ColumnConfiguration.class);
}
Aggregations