interface @Service

The @Service annotation is used in Modifiers and Mixins to obtain references to services provided by the domain model and/or the Qi4j runtime.

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 service dependency into a Fragment.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.FIELD, ElementType.PARAMETER } )
@Documented
@InjectionScope
public @interface Service
{
    /** True if the dependency is optional,
     *  only fail the injection if this is 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.