| | |
| | | import org.springframework.cglib.core.AbstractClassGenerator; |
| | | import org.springframework.cglib.core.ReflectUtils; |
| | | |
| | | /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/beans/BladeBeanMap.class */ |
| | | |
| | | public abstract class BladeBeanMap extends BeanMap { |
| | | /* renamed from: newInstance */ |
| | | public abstract BladeBeanMap m4newInstance(Object o); |
| | | public abstract BladeBeanMap newInstance(Object paramObject); |
| | | |
| | | protected BladeBeanMap() { |
| | | } |
| | |
| | | return gen.create(); |
| | | } |
| | | |
| | | /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/beans/BladeBeanMap$BladeGenerator.class */ |
| | | public static class BladeGenerator extends AbstractClassGenerator { |
| | | private static final AbstractClassGenerator.Source SOURCE = new AbstractClassGenerator.Source(BladeBeanMap.class.getName()); |
| | | |
| | | private Object bean; |
| | | |
| | | private Class beanClass; |
| | | |
| | | private int require; |
| | | |
| | | |
| | | public BladeGenerator() { |
| | | super(SOURCE); |
| | | super(SOURCE); |
| | | } |
| | | |
| | | |
| | | public void setBean(Object bean) { |
| | | this.bean = bean; |
| | | if (bean != null) { |
| | | this.beanClass = bean.getClass(); |
| | | } |
| | | this.bean = bean; |
| | | if (bean != null) |
| | | this.beanClass = bean.getClass(); |
| | | } |
| | | |
| | | |
| | | public void setBeanClass(Class beanClass) { |
| | | this.beanClass = beanClass; |
| | | this.beanClass = beanClass; |
| | | } |
| | | |
| | | |
| | | public void setRequire(int require) { |
| | | this.require = require; |
| | | this.require = require; |
| | | } |
| | | |
| | | |
| | | protected ClassLoader getDefaultClassLoader() { |
| | | return this.beanClass.getClassLoader(); |
| | | return this.beanClass.getClassLoader(); |
| | | } |
| | | |
| | | |
| | | protected ProtectionDomain getProtectionDomain() { |
| | | return ReflectUtils.getProtectionDomain(this.beanClass); |
| | | return ReflectUtils.getProtectionDomain(this.beanClass); |
| | | } |
| | | |
| | | |
| | | public BladeBeanMap create() { |
| | | if (this.beanClass == null) { |
| | | throw new IllegalArgumentException("Class of bean unknown"); |
| | | } |
| | | setNamePrefix(this.beanClass.getName()); |
| | | BladeBeanMapKey key = new BladeBeanMapKey(this.beanClass, this.require); |
| | | return (BladeBeanMap) super.create(key); |
| | | if (this.beanClass == null) |
| | | throw new IllegalArgumentException("Class of bean unknown"); |
| | | setNamePrefix(this.beanClass.getName()); |
| | | BladeBeanMapKey key = new BladeBeanMapKey(this.beanClass, this.require); |
| | | return (BladeBeanMap)create(key); |
| | | } |
| | | |
| | | |
| | | public void generateClass(ClassVisitor v) throws Exception { |
| | | new BladeBeanMapEmitter(v, getClassName(), this.beanClass, this.require); |
| | | new BladeBeanMapEmitter(v, getClassName(), this.beanClass, this.require); |
| | | } |
| | | |
| | | |
| | | protected Object firstInstance(Class type) { |
| | | return ((BeanMap) ReflectUtils.newInstance(type)).newInstance(this.bean); |
| | | return ((BeanMap)ReflectUtils.newInstance(type)).newInstance(this.bean); |
| | | } |
| | | |
| | | |
| | | protected Object nextInstance(Object instance) { |
| | | return ((BeanMap) instance).newInstance(this.bean); |
| | | return ((BeanMap)instance).newInstance(this.bean); |
| | | } |
| | | } |
| | | } |
| | | } |