Package org.dozer.config

Examples of org.dozer.config.BeanContainer


    String classLoaderName = globalSettings.getClassLoaderName();
    String proxyResolverName = globalSettings.getProxyResolverName();

    DefaultClassLoader defaultClassLoader = new DefaultClassLoader();
    BeanContainer beanContainer = BeanContainer.getInstance();

    Class<? extends DozerClassLoader> classLoaderType = loadBeanType(classLoaderName, defaultClassLoader, DozerClassLoader.class);
    Class<? extends DozerProxyResolver> proxyResolverType = loadBeanType(proxyResolverName, defaultClassLoader, DozerProxyResolver.class);

    DozerClassLoader classLoaderBean = ReflectionUtils.newInstance(classLoaderType);
    DozerProxyResolver proxyResolverBean = ReflectionUtils.newInstance(proxyResolverType);

    beanContainer.setClassLoader(classLoaderBean);
    beanContainer.setProxyResolver(proxyResolverBean);

    if (globalSettings.isElEnabled()) {
      ELEngine engine = new ELEngine();
      engine.init();
      beanContainer.setElEngine(engine);
      beanContainer.setElementReader(new ExpressionElementReader(engine));
    }
  }
View Full Code Here


      fieldMap.setCopyByReference(true);
    }
  }

  public static Class<?> loadClass(String name) {
    BeanContainer container = BeanContainer.getInstance();
    DozerClassLoader loader = container.getClassLoader();
    return loader.loadClass(name);
  }
View Full Code Here

    DozerClassLoader loader = container.getClassLoader();
    return loader.loadClass(name);
  }

  public static Class<?> getRealClass(Class<?> clazz) {
    BeanContainer container = BeanContainer.getInstance();
    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.getRealClass(clazz);
  }
View Full Code Here

    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.getRealClass(clazz);
  }

  public static <T> T deProxy(T object) {
    BeanContainer container = BeanContainer.getInstance();
    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.unenhanceObject(object);
  }
View Full Code Here

      }
    }
  }

  public static Class<?> loadClass(String name) {
    BeanContainer container = BeanContainer.getInstance();
    DozerClassLoader loader = container.getClassLoader();
    return loader.loadClass(name);
  }
View Full Code Here

    DozerClassLoader loader = container.getClassLoader();
    return loader.loadClass(name);
  }

  public static boolean isProxy(Class<?> clazz) {
    BeanContainer container = BeanContainer.getInstance();
    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.isProxy(clazz);
  }
View Full Code Here

    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.isProxy(clazz);
  }

  public static Class<?> getRealSuperclass(Class<?> clazz) {
    BeanContainer container = BeanContainer.getInstance();
    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.getRealSuperclass(clazz);
  }
View Full Code Here

    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.getRealSuperclass(clazz);
  }

  public static Class<?> getRealClass(Class<?> clazz) {
    BeanContainer container = BeanContainer.getInstance();
    DozerProxyResolver proxyResolver = container.getProxyResolver();
    return proxyResolver.getRealClass(clazz);
  }
View Full Code Here

    String classLoaderName = globalSettings.getClassLoaderName();
    String proxyResolverName = globalSettings.getProxyResolverName();

    DefaultClassLoader defaultClassLoader = new DefaultClassLoader();
    BeanContainer beanContainer = BeanContainer.getInstance();

    Class<? extends DozerClassLoader> classLoaderType = loadBeanType(classLoaderName, defaultClassLoader, DozerClassLoader.class);
    Class<? extends DozerProxyResolver> proxyResolverType = loadBeanType(proxyResolverName, defaultClassLoader, DozerProxyResolver.class);

    DozerClassLoader classLoaderBean = ReflectionUtils.newInstance(classLoaderType);
    DozerProxyResolver proxyResolverBean = ReflectionUtils.newInstance(proxyResolverType);

    beanContainer.setClassLoader(classLoaderBean);
    beanContainer.setProxyResolver(proxyResolverBean);

    if (globalSettings.isElEnabled()) {
      ELEngine engine = new ELEngine();
      engine.init();
      beanContainer.setElEngine(engine);
      beanContainer.setElementReader(new ExpressionElementReader(engine));
    }
  }
View Full Code Here

        log.warn("Unable to register Dozer JMX MBeans with the PlatformMBeanServer.  Dozer will still function "
            + "normally, but management via JMX may not be available", t);
      }
    }

    BeanContainer beanContainer = BeanContainer.getInstance();

    registerClassLoader(globalSettings, classLoader, beanContainer);
    registerProxyResolver(globalSettings, beanContainer);

    if (globalSettings.isElEnabled()) {
      ELEngine engine = new ELEngine();
      engine.init();
      beanContainer.setElEngine(engine);
      beanContainer.setElementReader(new ExpressionElementReader(engine));
    }

    for (DozerModule module : ServiceLoader.load(DozerModule.class)) {
      module.init();
    }
View Full Code Here

TOP

Related Classes of org.dozer.config.BeanContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.