> For the complete documentation index, see [llms.txt](https://failutee.gitbook.io/mineject/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://failutee.gitbook.io/mineject/core-features/beansetup-and-bean.md).

# @BeanSetup & @Bean

If you need to provide dependencies manually, you can use the <mark style="color:blue;">@BeanSetup</mark> annotation.

A method (provider) that has <mark style="color:blue;">@Bean</mark> annotations must return an object that will be added to the dependency list. Provider methods CAN BE STATIC!

```java
import xyz.failutee.mineject.annotation.Bean;
import xyz.failutee.mineject.annotation.BeanSetup;

@BeanSetup
public class TaskServiceSetup {
    
    @Bean
    TaskService taskService() {
        return new TaskService();
    }
}
```

Provider method can also accept parameters that will be automatically injected into the method! You can also inject dependencies into the constructor.

```java
import xyz.failutee.mineject.annotation.Bean;
import xyz.failutee.mineject.annotation.BeanSetup;
import xyz.failutee.mineject.annotation.Injectable;

@BeanSetup
public class TaskServiceSetup {

    @Injectable
    public TaskServiceSetup(TestManager testManager) {
        /* ... */
    }
    
    @Bean
    TaskService taskService(TestManager testManager) {
        return new TaskService();
    }
}

```
