Commit Graph

10 Commits

Author SHA1 Message Date
597065badc feat: add field injection after constructor injection
Enable @Inject field injection in the bean creation lifecycle. Fields are now injected after constructor injection and before PostConstruct invocation, allowing beans to use both constructor and field injection simultaneously.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 16:29:20 +08:00
c408107c48 fix: support @PostConstruct methods in parent classes
Recursively scan parent class hierarchy to collect all @PostConstruct
methods, ensuring parent methods are executed before child methods.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 16:21:40 +08:00
f5c6dcd275 refactor: optimize string concatenation and add startup statistics
- Replace string concatenation with .formatted() method for better readability
- Add StartupStatistics class to track initialization metrics
- Add detailed startup logging with timing information
  - Scan time
  - IOC time
  - Injection time
  - PostConstruct time
  - Total startup time
- Add banner output support (banner.txt or defBanner.txt)
- Add @Lazy annotation support for lazy initialization

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 01:41:49 +08:00
93bcc9b5c6 remove test demo 2026-01-13 00:37:26 +08:00
372026b716 fix @Import duplicate registration and add JavaFX demo test
- Fix @Import processing to skip already registered beans from package scan
- Add extractBeanName helper method for bean name extraction
- Set MainController to PROTOTYPE scope to avoid eager initialization
- Add FxDemoTest for testing JavaFX components without GUI
- Test configuration beans, services, and dependency injection
- All JavaFX demo components tested successfully

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 12:35:38 +08:00
13926ea24a add JavaFX demo application
- Add FxMain as JavaFX application entry with IOC integration
- Add FxConfig with @Bean factory methods for DateTimeFormatter
- Add MainController with constructor injection
- Add UserService and MessageService layers
- Add main.fxml view with user management UI
- Add javafx-fxml dependency and javafx-maven-plugin
- Add demo documentation and run script
- Demonstrate @Controller, @Service, @Qualifier, @PostConstruct in JavaFX context

Run with: mvn javafx:run or run-javafx-demo.bat

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 12:31:50 +08:00
71be7c07c0 implement lightweight IOC/DI framework
- Add annotation system (@Component, @Service, @Configuration, @Bean, @Inject, @Qualifier, @Primary, @Scope, @PostConstruct, @Import, @TimiInjectApplication)
- Implement BeanContext for managing bean instances and definitions
- Implement BeanScanner for component scanning (file system and jar)
- Implement BeanFactory with constructor injection and lifecycle support
- Support @Configuration and @Bean factory methods
- Support @Qualifier and @Primary for multi-implementation
- Support @Scope (singleton/prototype)
- Support @PostConstruct lifecycle callback
- Support @Import and Module extension
- Add circular dependency detection
- Add dependency graph export
- Add demo and test cases

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 12:26:14 +08:00
05606eda74 add injector to InjectApp 2025-07-15 16:46:05 +08:00
0970569738 Initial project 2025-07-14 11:57:11 +08:00
48273bd9f0 Initial commit 2025-07-14 03:24:01 +00:00