All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.thorbenkuck.di.annotations.Provider Maven / Gradle / Ivy

The newest version!
package com.github.thorbenkuck.di.annotations;

import java.lang.annotation.*;

/**
 * This annotation marks a method as a factory for a wired component.
 *
 * The annotated method must have a return value other than void and thereby marks it as a provider for the return
 * value. It is required that the annotated method does not return void.
 *
 * This might look like this:
 *
 * 
@Wire
 * public class Example {
 *     {@literal @Provider}
 *     public Value createValue(Dependency dependency) {
 *          // create the value
 *          return new Value(dependency);
 *     }
 * }
* * This mean that, when any wired component requests the "Value" dependency, there will be an IdentifiableProvider, * which will request the Example class and call the method "createValue". */ @Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) @Documented @Inherited public @interface Provider { }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy