Inherited from Serializable
Inherited by implicit conversion any2stringadd from
Factory[Output] to any2stringadd[Factory[Output]]
Inherited by implicit conversion StringFormat from
Factory[Output] to StringFormat[Factory[Output]]
Inherited by implicit conversion Ensuring from
Factory[Output] to Ensuring[Factory[Output]]
Inherited by implicit conversion ArrowAssoc from
Factory[Output] to ArrowAssoc[Factory[Output]]
A factory to create new instances, especially dynamic mix-ins.
Author:
杨博 (Yang Bo) <[email protected]>
Given a trait that has an abstract member.
When creating a factory for the trait.
val factory = Factory[Foo]
Then the newInstance method of the factory should accept one parameter.
Given two traits that have no abstract member.
When creating a factory for mix-in type of the two types.
Then the newInstance method of the factory should accept no parameters.
Given a trait that contains an abstract method annotated as @inject.
When creating a factory for the trait
Then the
@inject
method will be replaced to an implicit value.It will not compile if no implicit value found. For example,
Foo[Symbol]
requires an implicit value of typeOrdering[Symbol]
, which is not availble."Factory[Foo[Symbol]]" shouldNot compile
@inject works on implicit abstract methods as well.
,Factories may be nested