interface @This

This annotation is for member fields in Fragments. It provides a typed reference to the Composite instance that the Fragment is currently belonging to, OR to private mixins internal in the Composite.

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 reference
* to the same Composite as the fragment is a part of.
* <p/>
* If the Composite type does not implement the type
* of the field or parameter then it will be referencing
* a private mixin.
* <p/>
* Calls to the reference will have the same semantics
* as calls to the Composite itself.
* Specifically the same set of Fragments will be invoked.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.FIELD, ElementType.PARAMETER } )
@Documented
@InjectionScope
public @interface This
{
    /** True if the dependency is optional, only fail
     *  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.