@Incubating public interface ObjectFactory
An instance of the factory can be injected into a task or plugin by annotating a public constructor or method with javax.inject.Inject
. It is also available via Project.getObjects()
.
<T extends Named> T named(Class<T> type, String name)
Named
object of the given type and name.
The given type can be an interface that extends Named
or an abstract class that 'implements' Named
. An abstract class, if provided:
Named.getName()
and should define this method as abstract. Any implementation will be overridden.An interface, if provided, must not define or inherit any other methods.
Objects created using this method are not decorated or extensible.