Android Open Source - Kite Provided






From Project

Back to project page Kite.

License

The source code is released under:

Apache License

If you think the Android project Kite listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.kite.annotations;
//  w w w  . j  av  a  2  s  . co m
import org.kite.async.AsyncType;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marks that method or field of {@link org.kite.wire.WiredService} is
 * available after connection to dependency injection.<br/>
 * <b>Note, that if you mark field with it - you have to worry about it's initialization,
 * by the moment service is connected<br/>
 * If you mark method with it - it has to be getter-like, with no parameters.
 * </b>
 * <p>Async:</p>
 * By setting {@link #async()} type of exposing this method, you set
 * the behaviour of calling interface, marked with this annotation. Examine {@link org.kite.async.AsyncType}
 * for better understanding. Default async value is {@link org.kite.async.AsyncType#NONE}
 *
 * @see org.kite.async.AsyncType
 * @see org.kite.annotations.Wired
 * @see org.kite.wire.WiredService
 * @author Nikolay Soroka
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Provided {

    /**
     * Indicates scope to use with {@link Provided}
     *
     * @author Nikolay Soroka
     */
    public static enum Scope {
        /**Means that method or field will be available,
         * only when connecting without specifying {@link android.content.Intent}
         * {@code Action}.
         *
         */
        DEFAULT,

        /**Properties with this scope type will be available
         * where or not you have specified intent and action.
         *
         */
        ALL,

        /**Properties will be available only when you specify
         * {@link android.content.Intent} and it's action equals
         * to {@link org.kite.annotations.Provided#action()}
         *
         */
        ACTION
    }

    /**Specify the scope of method or field.<br/>
     * Default is {@link org.kite.annotations.Provided.Scope#DEFAULT}
     *
     */
    Scope scope() default Scope.DEFAULT;

    /**The action to match when checking intent scope.
     * Note, it's only used if {@link #scope()} is {@link Scope#ACTION}
     *
     */
    String action() default "";

    /**Marks that asynchronous calls
     * to this interface.
     * @see org.kite.annotations.AsyncMethod
     */
    AsyncType async() default AsyncType.NONE;
}




Java Source Code List

org.kite.annotations.AsyncMethod.java
org.kite.annotations.AsyncResult.java
org.kite.annotations.Provided.java
org.kite.annotations.Wired.java
org.kite.async.AsyncHandler.java
org.kite.async.AsyncType.java
org.kite.async.MethodResult.java
org.kite.async.ResultQueue.java
org.kite.sample.CalcFragment.java
org.kite.sample.CalcInterface.java
org.kite.sample.Calculator.java
org.kite.sample.MainActivity.java
org.kite.sample.SampleService.java
org.kite.sample.Substractor.java
org.kite.services.CommandService.java
org.kite.services.MainThreadExecutor.java
org.kite.wire.ClientFacade.java
org.kite.wire.InterfaceFinder.java
org.kite.wire.ServiceFacade.java
org.kite.wire.WireBinder.java
org.kite.wire.WireCallback.java
org.kite.wire.Wire.java
org.kite.wire.WiredService.java
org.kite.wire.package-info.java