jakarta library
The standard Java injection names, for code that prefers them to the
Spring ones: the JSR-330 Provider<T> (a bean looked up on each use)
and the JSR-250 annotations @Resource (inject by bean name) and
@Priority (rank beans of one type).
They are not part of spring_core_dart.dart because their names clash:
Provider with package:provider, Resource with this package's own
resource type. Import this library on its own, with a prefix where a
name clashes. Applications that use ObjectProvider, @Autowired,
@Qualifier and @Order do not need it.
import 'package:spring_core_dart/jakarta.dart' as jakarta;
@Service()
class Reports {
// Two stores exist; the archive one is wanted here.
@jakarta.Resource(name: 'archiveStore')
late final Store store;
}
Classes
- Priority
-
Ranks a bean among others of the same type: the JSR-250 annotation
jakarta.annotation.Priority, on a bean class (or@Beanmethod). -
Provider<
T extends Object> -
A handle that looks up a bean of
Teach time get is called: the JSR-330 form of a lazy dependency (jakarta.inject.Provider). - Resource
-
Injects a field or setter with the bean of a given name: the JSR-250
annotation
jakarta.annotation.Resource.