Class BeanGenerator

    • Constructor Detail

      • BeanGenerator

        public BeanGenerator()
    • Method Detail

      • setSuperclass

        public void setSuperclass​(java.lang.Class superclass)
        Set the class which the generated class will extend. The class must not be declared as final, and must have a non-private no-argument constructor.
        Parameters:
        superclass - class to extend, or null to extend Object
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.Class type)
      • getProtectionDomain

        protected java.security.ProtectionDomain getProtectionDomain()
        Description copied from class: AbstractClassGenerator
        Returns the protection domain to use when defining the class.

        Default implementation returns null for using a default protection domain. Sub-classes may override to use a more specific protection domain.

        Overrides:
        getProtectionDomain in class AbstractClassGenerator
        Returns:
        the protection domain (null for using a default)
      • create

        public java.lang.Object create()
      • createClass

        public java.lang.Object createClass()
      • createHelper

        private java.lang.Object createHelper()
      • generateClass

        public void generateClass​(org.objectweb.asm.ClassVisitor v)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProperties

        public static void addProperties​(BeanGenerator gen,
                                         java.util.Map props)
      • addProperties

        public static void addProperties​(BeanGenerator gen,
                                         java.lang.Class type)
      • addProperties

        public static void addProperties​(BeanGenerator gen,
                                         java.beans.PropertyDescriptor[] descriptors)