public DragomeConfigurator getConfigurator()
{
try
{
DragomeConfigurator foundConfigurator= null;
Reflections reflections= new Reflections("");
Set<Class<? extends DragomeConfigurator>> configurators= reflections.getSubTypesOf(DragomeConfigurator.class);
for (Class<? extends DragomeConfigurator> class1 : configurators)
if (!class1.equals(DefaultDragomeConfigurator.class))
foundConfigurator= class1.newInstance();
if (foundConfigurator == null)
{
Set<Class<?>> typesAnnotatedWith= reflections.getTypesAnnotatedWith(DragomeConfiguratorImplementor.class);
if (typesAnnotatedWith.isEmpty())
foundConfigurator= new DefaultDragomeConfigurator();
else
foundConfigurator= (DragomeConfigurator) typesAnnotatedWith.iterator().next().newInstance();
}