用注解实现回调

This commit is contained in:
AriaLyy
2017-06-06 18:16:44 +08:00
parent 0d59c7b421
commit 3b7a9eccb8
14 changed files with 281 additions and 3 deletions

1
AriaAnnotations/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

View File

@ -0,0 +1,12 @@
apply plugin: 'java'
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}

View File

@ -0,0 +1,42 @@
package com.arialyy.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by Aria.Lao on 2017/6/6.
*/
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface Download {
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onPre {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskPre {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskResume {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskStart {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskStop {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskCancel {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskFail {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskComplete {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskRunning {
}
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD)
public @interface onNoSupportBreakPoint {
}
}

View File

@ -0,0 +1,12 @@
package com.arialyy.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by Aria.Lao on 2017/6/6.
*/
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface Test {
}