@Test public void testResolveClasses() { assertEquals(ClassResolverTest.class, resolver.resolve("ClassResolverTest")); assertEquals(ClassesLister.class, resolver.resolve("ClassesLister")); assertEquals(Configuration.class, resolver.resolve("Configuration")); assertEquals(Sequence.class, resolver.resolve("Sequence")); assertEquals(InnerTestClass.class, resolver.resolve("InnerTestClass")); assertEquals(ArrayList.class, resolver.resolve("ArrayList")); }
public <T> Class<T> resolve(String name) { String simpleName = name.contains(".") ? name.substring(name.lastIndexOf('.') + 1) : name; if (simpleName.isEmpty()) { return null; } final Multimap<String, String> classesBySimpleName = getClassesLister().getClassesBySimpleName(); for (String className : classesBySimpleName.get(simpleName)) { if (className.contains(name)) { try { return genericCast(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException("A fatal error occured while loading a resolved class!", e); } } } return null; }
ClassResolver { public <T> Class<T> resolve(String name) { String simpleName = name.contains(".") ? name.substring(name.lastIndexOf('.') + 1) : name; if (simpleName.isEmpty()) { return null; } final Multimap<String, String> classesBySimpleName = getClassesLister().getClassesBySimpleName(); for (String className : classesBySimpleName.get(simpleName)) { if (className.contains(name)) { try { return genericCast(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException("A fatal error occured while loading a resolved class!", e); } } } return null; } }
ClassResolver { public <T> Class<T> resolve(String name) { String simpleName = name.contains(".") ? name.substring(name.lastIndexOf('.') + 1) : name; if (simpleName.isEmpty()) { return null; } final Multimap<String, String> classesBySimpleName = getClassesLister().getClassesBySimpleName(); for (String className : classesBySimpleName.get(simpleName)) { if (className.contains(name)) { try { return genericCast(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException("A fatal error occured while loading a resolved class!", e); } } } return null; } ClassResolver();  ClassResolver(Iterable<String> packages); }
ClassResolver { public <T> Class<T> resolve(String name) { String simpleName = name.contains(".") ? name.substring(name.lastIndexOf('.') + 1) : name; if (simpleName.isEmpty()) { return null; } final Multimap<String, String> classesBySimpleName = getClassesLister().getClassesBySimpleName(); for (String className : classesBySimpleName.get(simpleName)) { if (className.contains(name)) { try { return genericCast(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException("A fatal error occured while loading a resolved class!", e); } } } return null; } ClassResolver();  ClassResolver(Iterable<String> packages); static ClassResolver DefaultSingleton(); Class<T> resolveSafe(String className); Class<T> resolve(String name); ClassesLister getClassesLister(); static List<String> defaultPackages(); }
ClassResolver { public <T> Class<T> resolve(String name) { String simpleName = name.contains(".") ? name.substring(name.lastIndexOf('.') + 1) : name; if (simpleName.isEmpty()) { return null; } final Multimap<String, String> classesBySimpleName = getClassesLister().getClassesBySimpleName(); for (String className : classesBySimpleName.get(simpleName)) { if (className.contains(name)) { try { return genericCast(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException("A fatal error occured while loading a resolved class!", e); } } } return null; } ClassResolver();  ClassResolver(Iterable<String> packages); static ClassResolver DefaultSingleton(); Class<T> resolveSafe(String className); Class<T> resolve(String name); ClassesLister getClassesLister(); static List<String> defaultPackages();  }