interface @Uses

@Uses is an annotation to declare a dependency on an object injected via the CompositeBuilder.use( Object object ) method.

Description

Description goes here...

Declaration

package org.qi4j.api.injection.scope;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.qi4j.api.injection.InjectionScope;

/**
* Annotation to denote the injection of a dependency
* to be used by a Mixin.
* The injected object is provided by the CompositeBuilder.
* Call {@link org.qi4j.api.composite.CompositeBuilder#use}
* to provide the instance to be injected.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.PARAMETER, ElementType.FIELD } )
@Documented
@InjectionScope
public @interface Uses
{
    /** True if usage is optional, only fail if false.
     */
    boolean optional() default false;
}

Example

Example(s) goes here...

Qi4j and the Qi4j logo are trademarks of Richard Öberg, Niclas Hedhman and the members of the Qi4j Core Team. See Qi4j licensing for more information.
Powered by SiteVisionexternal link.