cls, int length) {
174 | if (!cls.isArray()) {
175 | return null;
176 | }
177 | int cnt = 1;
178 | Class> cmptType = cls.getComponentType();
179 | while (!cmptType.isArray()) {
180 | cmptType = cmptType.getComponentType();
181 | cnt += 1;
182 | }
183 | int[] dimensions = new int[cnt];
184 | Arrays.fill(dimensions, length);
185 | return (T) Array.newInstance(cmptType, dimensions);
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.fastlight
8 | fastaop-parent
9 | pom
10 | 1.0.2-SNAPSHOT
11 |
12 | fastapt
13 | fastaop
14 | example
15 |
16 |
17 |
18 | 8
19 | 8
20 | 1.0.2-SNAPSHOT
21 | UTF-8
22 |
23 | fastaop-parent
24 | java fastaop parent dependencies
25 | https://github.com/fast-light/fastaop
26 |
27 |
28 | scm:git:https://github.com/fast-light/fastaop.git
29 |
30 |
31 | scm:git:https://github.com/fast-light/fastaop.git
32 |
33 | https://github.com/fast-light/fastaop
34 | 1.0.0
35 |
36 |
37 |
38 | MIT License
39 | http://www.opensource.org/licenses/mit-license.php
40 |
41 |
42 |
43 |
44 | ychost
45 | ychost@outlook.com
46 | fastlight
47 | https://fastlight.org
48 |
49 |
50 |
51 |
52 |
53 | org.fastlight
54 | fastaop
55 | ${fast.version}
56 |
57 |
58 | org.fastlight
59 | fastapt
60 | ${fast.version}
61 |
62 |
63 | org.projectlombok
64 | lombok
65 | 1.18.16
66 |
67 |
68 |
69 | org.apache.commons
70 | commons-collections4
71 | 4.4
72 |
73 |
74 | org.apache.commons
75 | commons-lang3
76 | 3.9
77 |
78 |
79 |
80 | com.google.code.findbugs
81 | jsr305
82 | 3.0.2
83 |
84 |
85 | com.google.auto.service
86 | auto-service
87 | 1.0-rc7
88 |
89 |
90 | com.google.guava
91 | guava
92 | 21.0
93 |
94 |
95 | junit
96 | junit
97 | 4.13
98 | test
99 |
100 |
101 |
102 |
103 |
104 |
105 | ossrh
106 | https://s01.oss.sonatype.org/content/repositories/snapshots
107 |
108 |
109 | ossrh
110 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | src/main/resources
124 | true
125 |
126 |
127 |
128 |
129 |
130 | org.sonatype.plugins
131 | nexus-staging-maven-plugin
132 | 1.6.8
133 | true
134 |
135 | ossrh
136 | https://s01.oss.sonatype.org/
137 | true
138 |
139 |
140 |
141 |
142 | org.apache.maven.plugins
143 | maven-source-plugin
144 | 2.2.1
145 |
146 |
147 | compile
148 |
149 | jar
150 |
151 |
152 |
153 |
154 |
155 | org.apache.maven.plugins
156 | maven-surefire-plugin
157 | 2.22.0
158 |
159 |
160 |
161 | org.apache.maven.plugins
162 | maven-javadoc-plugin
163 | 3.2.0
164 |
165 |
166 |
167 | -Xdoclint:none
168 |
169 |
170 |
171 |
172 | attach-javadocs
173 |
174 | jar
175 |
176 |
177 |
178 |
179 |
180 | org.apache.maven.plugins
181 | maven-gpg-plugin
182 | 1.6
183 |
184 |
185 | sign-artifacts
186 | verify
187 |
188 | sign
189 |
190 |
191 |
192 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/readme-zh.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 |
6 |
13 |
14 |
15 | Java 轻量级 AOP 框架
16 |
17 |
18 |
21 |
22 |
23 | ## 简介
24 |
25 | FastAop 是一款基于 Java Annotation Processing 的轻量级 AOP 框架,其原理和 Lombok 类似
26 |
27 | ## 特性
28 |
29 | - 📦 开箱即用,适用于任意项目
30 | - 🚀 基于 Java Annotation Processing,运行时无性能损耗
31 | - ⚡️ 兼容 private/protected/static 等各种修饰符的方法
32 |
33 | ## 使用
34 |
35 | [FastAop 使用教程](https://fast-light.github.io/zh-CN).
36 |
37 | ## 编译项目
38 |
39 | ```
40 | $ mvn clean install
41 | ```
42 |
43 | IDEA 配置
44 |
45 | ```
46 | setting->build->compiler->Shared build process VM options: -Djps.track.ap.dependencies=false
47 | ```
48 |
49 | ## 说明
50 |
51 | FastAop 目前仅支持 Java8,暂不支持其它版本,后面会逐步对 Java9+ 进行支持适配
52 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 |
6 |
7 |
14 |
15 | Java lightweight AOP framework
16 |
17 |
20 |
21 | ## Intro
22 |
23 | A lightweight AOP framework based on Java Annotation Processing, Its principle is similar to that of Lombok
24 |
25 | ## Features
26 |
27 | - 📦 Out of the box, compatible with any project
28 | - 🚀 Based on Java Annotation Processing, high-performance
29 | - ⚡️ Suitable for arbitrary modifiers methods, like private,protected,static etc..
30 |
31 | ## Guide
32 |
33 | please visit [FastAop Guide](https://fast-light.github.io/).
34 |
35 | ## Development
36 |
37 | ```
38 | $ mvn clean install
39 | ```
40 |
41 | IDEA setting
42 |
43 | ```
44 | setting->build->compiler->Shared build process VM options: -Djps.track.ap.dependencies=false
45 | ```
46 |
47 | ## Note
48 |
49 | FastAop currently only supports Java 8, and does not support other versions at the moment. Later, it will gradually support and adapt to Java 9+
50 |
--------------------------------------------------------------------------------
/resource/Alibaba-CodeStyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/resource/aop-debug.sh:
--------------------------------------------------------------------------------
1 | alias debug="mvnDebug clean install -Dmaven.test.skip=true"
2 | alias install="mvn clean install -Dmaven.test.skip=true"
3 | install && \
4 | cd ../example && debug
--------------------------------------------------------------------------------
/resource/aop-dev.sh:
--------------------------------------------------------------------------------
1 | alias install="mvn clean install -Dmaven.test.skip=true"
2 | install && \
3 | cd ../example && install
--------------------------------------------------------------------------------
/resource/install.sh:
--------------------------------------------------------------------------------
1 | alias install="mvn clean install -Dmaven.test.skip=true"
2 | cd ../fastapt && install && \
3 | cd ../fastaop && install
--------------------------------------------------------------------------------
/resource/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fast-light/fastaop/b4c9e3bf339a0bd8927e95e812f387355e28c4a7/resource/logo.png
--------------------------------------------------------------------------------