|
20 | 20 | */ |
21 | 21 | package com.ly.doc.model; |
22 | 22 |
|
23 | | -import com.ly.doc.utils.ParamUtil; |
24 | | -import com.thoughtworks.qdox.model.JavaClass; |
25 | | -import com.thoughtworks.qdox.model.JavaMethod; |
26 | | -import com.thoughtworks.qdox.model.JavaType; |
27 | | - |
28 | | -import java.util.List; |
29 | | -import java.util.Map; |
30 | | - |
31 | 23 | /** |
32 | 24 | * for rpc |
| 25 | + * |
33 | 26 | * @author yu 2020/1/29. |
34 | 27 | */ |
35 | | -public class RpcJavaMethod implements IMethod { |
36 | | - |
37 | | - /** |
38 | | - * java method |
39 | | - */ |
40 | | - private JavaMethod javaMethod; |
41 | | - |
42 | | - /** |
43 | | - * methodId handled by md5 |
44 | | - */ |
45 | | - private String methodId; |
46 | | - |
47 | | - /** |
48 | | - * method name |
49 | | - */ |
50 | | - private String name; |
51 | | - |
52 | | - /** |
53 | | - * method order |
54 | | - */ |
55 | | - private int order; |
56 | | - |
57 | | - |
58 | | - /** |
59 | | - * method description |
60 | | - */ |
61 | | - private String desc; |
62 | | - |
63 | | - /** |
64 | | - * method definition |
65 | | - */ |
66 | | - private String methodDefinition; |
67 | | - |
68 | | - /** |
69 | | - * escape method definition |
70 | | - */ |
71 | | - private String escapeMethodDefinition; |
72 | | - |
73 | | - /** |
74 | | - * detailed introduction of the method |
75 | | - */ |
76 | | - private String detail; |
77 | | - |
78 | | - /** |
79 | | - * method describe |
80 | | - */ |
81 | | - private String throwsInfo; |
82 | | - |
83 | | - /** |
84 | | - * return class Info |
85 | | - */ |
86 | | - private String returnClassInfo; |
87 | | - |
88 | | - /** |
89 | | - * http request params |
90 | | - */ |
91 | | - private List<ApiParam> requestParams; |
92 | | - |
93 | | - /** |
94 | | - * http request author |
95 | | - */ |
96 | | - private String author; |
97 | | - |
98 | | - /** |
99 | | - * http response params |
100 | | - */ |
101 | | - private List<ApiParam> responseParams; |
102 | | - |
103 | | - /** |
104 | | - * method deprecated |
105 | | - */ |
106 | | - private boolean deprecated; |
107 | | - |
108 | | - private Map<String, JavaType> actualTypesMap; |
109 | | - |
110 | | - |
111 | | - private String version; |
112 | | - |
113 | | - public String getVersion() { |
114 | | - return version; |
115 | | - } |
116 | | - |
117 | | - public RpcJavaMethod setVersion(String version) { |
118 | | - this.version = version; |
119 | | - return this; |
120 | | - } |
121 | | - |
122 | | - public static RpcJavaMethod builder() { |
123 | | - return new RpcJavaMethod(); |
124 | | - } |
125 | | - |
126 | | - public JavaMethod getJavaMethod() { |
127 | | - return javaMethod; |
128 | | - } |
129 | | - |
130 | | - public RpcJavaMethod setJavaMethod(JavaMethod javaMethod) { |
131 | | - this.javaMethod = javaMethod; |
132 | | - return this; |
133 | | - } |
134 | | - |
135 | | - public String getMethodId() { |
136 | | - return methodId; |
137 | | - } |
138 | | - |
139 | | - public RpcJavaMethod setMethodId(String methodId) { |
140 | | - this.methodId = methodId; |
141 | | - return this; |
142 | | - } |
143 | | - |
144 | | - public String getName() { |
145 | | - return name; |
146 | | - } |
147 | | - |
148 | | - public RpcJavaMethod setName(String name) { |
149 | | - this.name = name; |
150 | | - return this; |
151 | | - } |
152 | | - |
153 | | - public int getOrder() { |
154 | | - return order; |
155 | | - } |
156 | | - |
157 | | - public RpcJavaMethod setOrder(int order) { |
158 | | - this.order = order; |
159 | | - return this; |
160 | | - } |
161 | | - |
162 | | - public String getDesc() { |
163 | | - return desc; |
164 | | - } |
165 | | - |
166 | | - public RpcJavaMethod setDesc(String desc) { |
167 | | - this.desc = desc; |
168 | | - return this; |
169 | | - } |
170 | | - |
171 | | - public String getDetail() { |
172 | | - return detail; |
173 | | - } |
174 | | - |
175 | | - public RpcJavaMethod setDetail(String detail) { |
176 | | - this.detail = detail; |
177 | | - return this; |
178 | | - } |
179 | | - |
180 | | - public String getThrowsInfo() { |
181 | | - return throwsInfo; |
182 | | - } |
183 | | - |
184 | | - public RpcJavaMethod setThrowsInfo(String throwsInfo) { |
185 | | - this.throwsInfo = throwsInfo; |
186 | | - return this; |
187 | | - } |
188 | | - |
189 | | - public String getReturnClassInfo() { |
190 | | - return returnClassInfo; |
191 | | - } |
192 | | - |
193 | | - public RpcJavaMethod setReturnClassInfo(String returnClassInfo) { |
194 | | - this.returnClassInfo = returnClassInfo; |
195 | | - return this; |
196 | | - } |
197 | | - |
198 | | - public String getAuthor() { |
199 | | - return author; |
200 | | - } |
201 | | - |
202 | | - public RpcJavaMethod setAuthor(String author) { |
203 | | - this.author = author; |
204 | | - return this; |
205 | | - } |
206 | | - |
207 | | - public List<ApiParam> getResponseParams() { |
208 | | - return responseParams; |
209 | | - } |
210 | | - |
211 | | - public RpcJavaMethod setResponseParams(List<ApiParam> responseParams) { |
212 | | - this.responseParams = responseParams; |
213 | | - return this; |
214 | | - } |
215 | | - |
216 | | - public boolean isDeprecated() { |
217 | | - return deprecated; |
218 | | - } |
219 | | - |
220 | | - public RpcJavaMethod setDeprecated(boolean deprecated) { |
221 | | - this.deprecated = deprecated; |
222 | | - return this; |
223 | | - } |
224 | | - |
225 | | - public List<ApiParam> getRequestParams() { |
226 | | - return requestParams; |
227 | | - } |
228 | | - |
229 | | - public RpcJavaMethod setRequestParams(List<ApiParam> requestParams) { |
230 | | - this.requestParams = requestParams; |
231 | | - return this; |
232 | | - } |
233 | | - |
234 | | - public String getMethodDefinition() { |
235 | | - return methodDefinition; |
236 | | - } |
237 | | - |
238 | | - public RpcJavaMethod setMethodDefinition(String methodDefinition) { |
239 | | - this.methodDefinition = methodDefinition; |
240 | | - return this; |
241 | | - } |
242 | | - |
243 | | - public String getEscapeMethodDefinition() { |
244 | | - return escapeMethodDefinition; |
245 | | - } |
246 | | - |
247 | | - public RpcJavaMethod setEscapeMethodDefinition(String escapeMethodDefinition) { |
248 | | - this.escapeMethodDefinition = escapeMethodDefinition; |
249 | | - return this; |
250 | | - } |
251 | | - |
252 | | - public Map<String, JavaType> getActualTypesMap() { |
253 | | - return actualTypesMap; |
254 | | - } |
255 | | - |
256 | | - public RpcJavaMethod setActualTypesMap(Map<String, JavaType> actualTypesMap) { |
257 | | - this.actualTypesMap = actualTypesMap; |
258 | | - return this; |
259 | | - } |
260 | | - |
261 | | - @Override |
262 | | - public JavaClass getDeclaringClass() { |
263 | | - return this.javaMethod.getDeclaringClass(); |
264 | | - } |
265 | | - |
266 | | - @Override |
267 | | - public String getMethodName() { |
268 | | - return this.name; |
269 | | - } |
270 | | - |
271 | | - @Override |
272 | | - public List<String> getArgsClasses() { |
273 | | - return ParamUtil.extractQualifiedName(this.requestParams); |
274 | | - } |
| 28 | +public class RpcJavaMethod extends JavadocJavaMethod { |
275 | 29 |
|
276 | | - @Override |
277 | | - public List<String> getReturnClasses() { |
278 | | - return ParamUtil.extractQualifiedName(this.responseParams); |
279 | | - } |
280 | 30 | } |
0 commit comments