Top Inners Fields Constructors Methods
org.springframework.cglib.beans

public Class BeanGenerator

extends AbstractClassGenerator
Class Inheritance
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
java.beans.PropertyDescriptor, java.security.ProtectionDomain, java.util.HashMap, .Iterator, .Map, org.springframework.asm.ClassVisitor, .Type, org.springframework.cglib.core.AbstractClassGenerator, .ClassEmitter, .Constants, .EmitUtils, .KeyFactory, .ReflectUtils

Author
Juozas Baliuka, Chris Nokleberg

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private boolean
private static final BeanGenerator.BeanGeneratorKey
private Map<K, V>
private static final AbstractClassGenerator.Source
private Class<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
addProperties(BeanGenerator gen, Map<K, V> props)

public static void
public static void
public void
addProperty(String name, Class<T> type)

public Object
public Object
private Object
protected Object
public void
protected ClassLoader
protected ProtectionDomain
getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Returns the protection domain to use when defining the class.

protected Object
public void
setSuperclass(Class<T>
class to extend, or null to extend Object
superclass
)

Set the class which the generated class will extend.

Inherited from org.springframework.cglib.core.AbstractClassGenerator:
creategenerategetAttemptLoadgetClassLoadergetClassNamegetCurrentgetNamingPolicygetStrategygetUseCachesetAttemptLoadsetClassLoadersetContextClasssetNamePrefixsetNamingPolicysetStrategysetUseCacheunwrapCachedValuewrapCachedClass

Field Detail

classOnlyback to summary
private boolean classOnly
KEY_FACTORYback to summary
private static final BeanGenerator.BeanGeneratorKey KEY_FACTORY
propsback to summary
private Map<K, V> props
SOURCEback to summary
private static final AbstractClassGenerator.Source SOURCE
superclassback to summary
private Class<T> superclass

Constructor Detail

BeanGeneratorback to summary
public BeanGenerator()

Method Detail

addPropertiesback to summary
public static void addProperties(BeanGenerator gen, Map<K, V> props)
addPropertiesback to summary
public static void addProperties(BeanGenerator gen, Class<T> type)
addPropertiesback to summary
public static void addProperties(BeanGenerator gen, PropertyDescriptor[] descriptors)
addPropertyback to summary
public void addProperty(String name, Class<T> type)
createback to summary
public Object create()
createClassback to summary
public Object createClass()
createHelperback to summary
private Object createHelper()
firstInstanceback to summary
protected Object firstInstance(Class<T> type)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.firstInstance.

Annotations
@Override
generateClassback to summary
public void generateClass(ClassVisitor v) throws Exception

Implements org.springframework.cglib.core.ClassGenerator.generateClass.

Annotations
@Override
getDefaultClassLoaderback to summary
protected ClassLoader getDefaultClassLoader()

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.getDefaultClassLoader.

Annotations
@Override
getProtectionDomainback to summary
protected ProtectionDomain getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Doc from org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

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.

Returns:ProtectionDomain

the protection domain (null for using a default)

Annotations
@Override
nextInstanceback to summary
protected Object nextInstance(Object instance)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.nextInstance.

Annotations
@Override
setSuperclassback to summary
public void setSuperclass(Class<T> 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<T>

class to extend, or null to extend Object

org.springframework.cglib.beans back to summary

pack-priv Interface BeanGenerator.BeanGeneratorKey


Method Summary

Modifier and TypeMethod and Description
public Object
newInstance(String superclass, Map<K, V> props)

Method Detail

newInstanceback to summary
public Object newInstance(String superclass, Map<K, V> props)