Package jodd.petite
Class BeanDefinition<T>
- java.lang.Object
-
- jodd.petite.BeanDefinition<T>
-
- Direct Known Subclasses:
ProxettaBeanDefinition
public class BeanDefinition<T> extends java.lang.ObjectPetite bean definition and cache. Consist of bean data that defines a bean and cache, that might not be initialized (ifnull). To initialize cache, get the bean instance from container.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Consumer<T>consumerprotected CtorInjectionPointctorprotected DestroyMethodPoint[]destroyMethodsprotected InitMethodPoint[]initMethodsprotected MethodInjectionPoint[]methodsprotected java.lang.Stringnameprotected java.lang.String[]paramsprotected PropertyInjectionPoint[]propertiesprotected Scopescopeprotected SetInjectionPoint[]setsprotected java.lang.Class<T>typeprotected ValueInjectionPoint[]valuesprotected WiringModewiringMode
-
Constructor Summary
Constructors Constructor Description BeanDefinition(java.lang.String name, java.lang.Class<T> type, Scope scope, WiringMode wiringMode, java.util.function.Consumer<T> beanInitConsumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDestroyMethodPoints(DestroyMethodPoint[] methods)Adds destroy methods.protected voidaddInitMethodPoints(InitMethodPoint[] methods)Adds init methods.protected voidaddMethodInjectionPoint(MethodInjectionPoint mip)Adds method injection point.protected voidaddPropertyInjectionPoint(PropertyInjectionPoint pip)Adds property injection point.protected voidaddSetInjectionPoint(SetInjectionPoint sip)Adds set injection point.java.util.function.Consumer<T>consumer()Returns an optional consumer.CtorInjectionPointctorInjectionPoint()Returns constructor injection point.DestroyMethodPoint[]destroyMethodPoints()Returns destroy method points.InitMethodPoint[]initMethodPoints()Returns init method points.MethodInjectionPoint[]methodInjectionPoints()Returns method injection points.java.lang.Stringname()Returns bean name.java.lang.String[]params()Returns parameters.PropertyInjectionPoint[]propertyInjectionPoints()Returns property injection points.java.lang.Class<? extends Scope>scope()Returns beans scope type.protected java.lang.ObjectscopeLookup()Delegates toScope.lookup(String).protected voidscopeRegister(java.lang.Object object)Delegates toScope.register(jodd.petite.BeanDefinition, Object)if scope is defined.protected voidscopeRemove()Delegates toScope.remove(String).SetInjectionPoint[]setterInjectionPoints()Returns set injection points.java.lang.StringtoString()java.lang.Class<T>type()Returns bean type.WiringModewiringMode()Returns wiring mode.
-
-
-
Field Detail
-
name
protected final java.lang.String name
-
type
protected final java.lang.Class<T> type
-
scope
protected final Scope scope
-
wiringMode
protected final WiringMode wiringMode
-
consumer
protected final java.util.function.Consumer<T> consumer
-
ctor
protected CtorInjectionPoint ctor
-
properties
protected PropertyInjectionPoint[] properties
-
sets
protected SetInjectionPoint[] sets
-
methods
protected MethodInjectionPoint[] methods
-
initMethods
protected InitMethodPoint[] initMethods
-
destroyMethods
protected DestroyMethodPoint[] destroyMethods
-
params
protected java.lang.String[] params
-
values
protected ValueInjectionPoint[] values
-
-
Constructor Detail
-
BeanDefinition
public BeanDefinition(java.lang.String name, java.lang.Class<T> type, Scope scope, WiringMode wiringMode, java.util.function.Consumer<T> beanInitConsumer)
-
-
Method Detail
-
name
public java.lang.String name()
Returns bean name.
-
type
public java.lang.Class<T> type()
Returns bean type.
-
scope
public java.lang.Class<? extends Scope> scope()
Returns beans scope type.
-
wiringMode
public WiringMode wiringMode()
Returns wiring mode.
-
consumer
public java.util.function.Consumer<T> consumer()
Returns an optional consumer.
-
ctorInjectionPoint
public CtorInjectionPoint ctorInjectionPoint()
Returns constructor injection point.
-
propertyInjectionPoints
public PropertyInjectionPoint[] propertyInjectionPoints()
Returns property injection points.
-
setterInjectionPoints
public SetInjectionPoint[] setterInjectionPoints()
Returns set injection points.
-
methodInjectionPoints
public MethodInjectionPoint[] methodInjectionPoints()
Returns method injection points.
-
initMethodPoints
public InitMethodPoint[] initMethodPoints()
Returns init method points.
-
destroyMethodPoints
public DestroyMethodPoint[] destroyMethodPoints()
Returns destroy method points.
-
params
public java.lang.String[] params()
Returns parameters.
-
scopeLookup
protected java.lang.Object scopeLookup()
Delegates toScope.lookup(String).
-
scopeRegister
protected void scopeRegister(java.lang.Object object)
Delegates toScope.register(jodd.petite.BeanDefinition, Object)if scope is defined.
-
scopeRemove
protected void scopeRemove()
Delegates toScope.remove(String).
-
addPropertyInjectionPoint
protected void addPropertyInjectionPoint(PropertyInjectionPoint pip)
Adds property injection point.
-
addSetInjectionPoint
protected void addSetInjectionPoint(SetInjectionPoint sip)
Adds set injection point.
-
addMethodInjectionPoint
protected void addMethodInjectionPoint(MethodInjectionPoint mip)
Adds method injection point.
-
addInitMethodPoints
protected void addInitMethodPoints(InitMethodPoint[] methods)
Adds init methods.
-
addDestroyMethodPoints
protected void addDestroyMethodPoints(DestroyMethodPoint[] methods)
Adds destroy methods.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-