public static class BeanMap.Generator extends AbstractClassGenerator
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
BeanMap.Generator.BeanMapKey |
AbstractClassGenerator.ClassLoaderData, AbstractClassGenerator.Source
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
bean |
private java.lang.Class |
beanClass |
private static BeanMap.Generator.BeanMapKey |
KEY_FACTORY |
private int |
require |
private static AbstractClassGenerator.Source |
SOURCE |
Constructor and Description |
---|
Generator() |
Modifier and Type | Method and Description |
---|---|
BeanMap |
create()
Create a new instance of the
BeanMap . |
protected java.lang.Object |
firstInstance(java.lang.Class type) |
void |
generateClass(org.objectweb.asm.ClassVisitor v) |
protected java.lang.ClassLoader |
getDefaultClassLoader() |
protected java.security.ProtectionDomain |
getProtectionDomain()
Returns the protection domain to use when defining the class.
|
protected java.lang.Object |
nextInstance(java.lang.Object instance) |
void |
setBean(java.lang.Object bean)
Set the bean that the generated map should reflect.
|
void |
setBeanClass(java.lang.Class beanClass)
Set the class of the bean that the generated map should support.
|
void |
setRequire(int require)
Limit the properties reflected by the generated map.
|
create, generate, getAttemptLoad, getClassLoader, getClassName, getCurrent, getNamingPolicy, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setNamePrefix, setNamingPolicy, setStrategy, setUseCache, unwrapCachedValue, wrapCachedClass
private static final AbstractClassGenerator.Source SOURCE
private static final BeanMap.Generator.BeanMapKey KEY_FACTORY
private java.lang.Object bean
private java.lang.Class beanClass
private int require
public void setBean(java.lang.Object bean)
setBean(java.lang.Object)
.
Calling this method overrides any value previously set using setBeanClass(java.lang.Class)
.
You must call either this method or setBeanClass(java.lang.Class)
before create()
.bean
- the initial beanpublic void setBeanClass(java.lang.Class beanClass)
setBeanClass(java.lang.Class)
before create()
.beanClass
- the class of the beanpublic void setRequire(int require)
require
- any combination of BeanMap.REQUIRE_GETTER
and
BeanMap.REQUIRE_SETTER
; default is zero (any property allowed)protected java.lang.ClassLoader getDefaultClassLoader()
getDefaultClassLoader
in class AbstractClassGenerator
protected java.security.ProtectionDomain getProtectionDomain()
AbstractClassGenerator
Default implementation returns null
for using a default protection domain. Sub-classes may
override to use a more specific protection domain.
getProtectionDomain
in class AbstractClassGenerator
null
for using a default)public BeanMap create()
BeanMap
. An existing
generated class will be reused if possible.public void generateClass(org.objectweb.asm.ClassVisitor v) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object firstInstance(java.lang.Class type)
firstInstance
in class AbstractClassGenerator
protected java.lang.Object nextInstance(java.lang.Object instance)
nextInstance
in class AbstractClassGenerator