public class IBean extends Object
Sample:
SomeBeanType bean = IBean.newOf(SomeBeanType.class);
SomeBeanType needs to be a valid IBean interface type. See also
IBeanFactory for a explanation what interfaces build up a valid IBean
type. IBean.
In many cases IBean is the main - and sometimes even only - class
that needs to be used from the IBean framework. Basically
IBean is just a convenience class that is supposed to be used as a
singleton and that holds a static instance of a IBeanFactory which
does the actual job of bean creation.
In most scenarios only one IBeanFactory is needed and this factory
can be made available to rest of the code using IBean. IBean
contains a preset default factory. If a customized factory should be used
instead the static instance can be changed via
setFactory(IBeanFactory). See also ProxyIBeanFactory for how
to create customized factories.
The predefined IBeanFactory inside IBean has following
characteristics:
ProxyIBeanFactory.ClassicBeanStyle)ToStringStyle.| Constructor and Description |
|---|
IBean() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
newOf(Class<T> beanType) |
static void |
resetToDefaultFactory() |
static void |
setFactory(IBeanFactory newFactory) |
public static <T> T newOf(Class<T> beanType)
public static void setFactory(IBeanFactory newFactory)
public static void resetToDefaultFactory()