List of usage examples for java.lang ReflectiveOperationException ReflectiveOperationException
public ReflectiveOperationException()
From source file:fr.juanwolf.mysqlbinlogreplicator.component.DomainClassAnalyzer.java
public Object generateInstanceFromName(String name) throws ReflectiveOperationException { DomainClass domainClass = domainClassMap.get(name); if (domainClass == null) { log.error("Class with name {} not found.", name); throw new ReflectiveOperationException(); }/*from w w w. jav a2 s .c om*/ Class classAsked = domainClassMap.get(name).getDomainClass(); try { Constructor classConstructor = classAsked.getConstructor(); return classConstructor.newInstance(); } catch (Exception e) { log.error("Impossible to instantiate an instance of {}: " + "no empty constructor found or the constructor is private for class {}", name, name); } // Should never happen. return null; }