|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.Component<T>
jfun.yan.SimpleComponent<T>
public abstract class SimpleComponent<T>
This abstract class provides a convenient way to create Component implementations that do not have dependencies to resolve.
| Constructor Summary | |
|---|---|
SimpleComponent(java.lang.Class type)
|
|
| Method Summary | |
|---|---|
abstract T |
create()
Subclasses can override this method to provide actual creation logic. |
T |
create(Dependency dep)
Create a component instance. |
java.lang.Class |
getType()
Get the type of instances that this component is responsible to create. |
boolean |
isConcrete()
To determine if the type returned by getType() is the concrete type of the real instance. |
boolean |
isSingleton()
Determines if the component always return the same instance and has no side-effect that causes difference when called the second time. |
java.lang.String |
toString()
|
java.lang.Class |
verify(Dependency dep)
Verifies that the component's dependencies are satisfiable. |
| Methods inherited from class jfun.yan.Component |
|---|
bean, bean, bean, bind, bind, bindArgument, bindArguments, bindProperties, bindProperty, cast, factory, factory, factory, factory, factory, field, field, field, followedBy, followedBy, followedBy, fromArguments, fromProperties, getState, getter, getter, guard, ifelse, ignoreProperty, incomplete, label, label, map, method, method, method, method, method, mutate, option, optional, optionalParameter, optionalParameters, optionalProperties, optionalProperty, proxy, proxy, proxy, recover, repeat, seal, seq, setter, setter, singleton, singleton, subsume, synchronize, withArgument, withArgument, withArguments, withArguments, withDefaultArgument, withDefaultProperty, withProperties, withProperties, withProperties, withProperty, withProperty, withState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleComponent(java.lang.Class type)
| Method Detail |
|---|
public java.lang.Class getType()
Component
getType in interface Creator<T>getType in interface TypefulgetType in class Component<T>public boolean isConcrete()
CreatorA strict static type check will be performed on concrete types.
public T create(Dependency dep)
Creator
dep - the provider that provides all dependent data.
public java.lang.Class verify(Dependency dep)
Verifiable
dep - the provider that provides all dependent information.
public abstract T create()
throws java.lang.Throwable
java.lang.Throwable - any error can be thrown out of here.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isSingleton()
CreatorThis information may be useful to certain optimizations.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||