Example #1
0
 public <E> E createNewInstance(Class<E> eClass) {
   try {
     return eClass.getConstructor(null).newInstance(null);
   } catch (Exception e) {
     throw new IllegalArgumentException(e.getMessage(), e);
   }
 }
Example #2
0
  private BaseFacade getFacadeBy0(Class eClass) {
    try {
      String name = "get" + eClass.getSimpleName().replaceAll("Entity", "") + "Facade";

      Method method = this.getClass().getMethod(name, null);

      return (BaseFacade) method.invoke(null, null);
    } catch (Exception e) {
      throw new IllegalArgumentException(e);
    }
  }
Example #3
0
 private <T> T getBean(Class<T> aClass) {
   String name = aClass.getSimpleName();
   name = StringUtils.lowerCase(name.substring(0, 1)) + name.substring(1);
   return (T) applicationContext.getBean(name);
 }