Class BeanUtil


  • public class BeanUtil
    extends java.lang.Object
    Utility class for instantiating configurable bean classes.
    Since:
    1.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void configure​(java.lang.Object bean, java.util.Properties props)
      Sets properties on a bean object using default type handlers.
      static java.lang.Object createBean​(java.lang.ClassLoader classLoader, java.lang.String className)
      Instantiates a bean class using its class name.
      static java.lang.Object createBean​(java.lang.ClassLoader classLoader, java.lang.String className, java.util.Properties props)
      Instantiates a bean class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createBean

        public static java.lang.Object createBean​(java.lang.ClassLoader classLoader,
                                                  java.lang.String className,
                                                  java.util.Properties props)
        Instantiates a bean class.
        Parameters:
        classLoader - the ClassLoader to use to resolve className
        className - the fully qualified name of the bean class to create
        props - the bean properties to set on the instantiated object
        Returns:
        the created bean object
      • createBean

        public static java.lang.Object createBean​(java.lang.ClassLoader classLoader,
                                                  java.lang.String className)
        Instantiates a bean class using its class name.
        Parameters:
        className - the fully qualified name of the class to instantiate
        Returns:
        the created bean object
      • configure

        public static void configure​(java.lang.Object bean,
                                     java.util.Properties props)
        Sets properties on a bean object using default type handlers.
        Parameters:
        bean - the object to set the properties on
        props - the bean properties to set on the object