Commit d3f0c5c
authored
[generator] Fix parameter string in ref doc links (#935)
Fixes: #931
Fixes: #932
We have a handful of issues in the https://developer.android.com/
links that are generated for various type members with complex
parameters. Collections, varargs, and generics are some examples of
items that are not translated correctly when generating the parameter
portion of the reference documentation URL.
The XML generated by `java-source-utils` when processing
`android-stubs-src.jar` contains `<parameter/>` elements under all
methods. The `<parameter/>` elements contain attributes with
additional type data; for instance:
<method jni-return="Landroid/animation/ObjectAnimator;" jni-signature="(Ljava/lang/Object;Landroid/util/Property;Landroid/util/Property;Landroid/graphics/Path;)Landroid/animation/ObjectAnimator;" name="ofFloat" return="android.animation.ObjectAnimator">
<parameter jni-type="Ljava/lang/Object;" name="target" type="T"/>
<parameter jni-type="Landroid/util/Property;" name="xProperty" type="android.util.Property<T, java.lang.Float>"/>
<parameter jni-type="Landroid/util/Property;" name="yProperty" type="android.util.Property<T, java.lang.Float>"/>
<parameter jni-type="Landroid/graphics/Path;" name="path" type="android.graphics.Path"/>
<javadoc>
<![CDATA[Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
using two properties. A <code>Path</code></> animation moves in two dimensions, animating
coordinates <code>(x, y)</code> together to follow the line. In this variation, the
coordinates are floats that are set to separate properties, <code>xProperty</code> and
<code>yProperty</code>.
@param target The object whose properties are to be animated.
@param xProperty The property for the x coordinate being animated.
@param yProperty The property for the y coordinate being animated.
@param path The <code>Path</code> to animate values along.
@return An ObjectAnimator object that is set up to animate along <code>path</code>.]]>
</javadoc>
</method>
Rather than processing the `//method/@jni-signature` attribute of the
method, use the `//method/parameter/@type` attribute values to create
more reliable type information for our reference documentation links.
With these changes in place, instead of e.g.
https://developer.android.com/reference/android/accounts/AccountManager#addAccount(java.lang.String,%20java.lang.String,%20java.lang.String[],%20android.os.Bundle,%20android.app.Activity,%20android.accounts.AccountManagerCallback,%20android.os.Handler)
which doesn't anchor to the intended method documentation, we now emit
https://developer.android.com/reference/android/accounts/AccountManager#addAccount(java.lang.String,%20java.lang.String,%20java.lang.String[],%20android.os.Bundle,%20android.app.Activity,%20android.accounts.AccountManagerCallback%3Candroid.os.Bundle%3E,%20android.os.Handler)
which *does* anchor to the intended method documentation.1 parent d64087c commit d3f0c5c
File tree
1 file changed
+27
-99
lines changed- tools/generator/Java.Interop.Tools.Generator.ObjectModel
1 file changed
+27
-99
lines changedLines changed: 27 additions & 99 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
84 | 96 | | |
85 | 97 | | |
86 | | - | |
| 98 | + | |
87 | 99 | | |
88 | 100 | | |
89 | 101 | | |
| |||
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
110 | | - | |
| 122 | + | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
| |||
217 | 229 | | |
218 | 230 | | |
219 | 231 | | |
220 | | - | |
| 232 | + | |
221 | 233 | | |
222 | | - | |
223 | 234 | | |
224 | 235 | | |
225 | 236 | | |
226 | | - | |
| 237 | + | |
227 | 238 | | |
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
231 | | - | |
| 242 | + | |
232 | 243 | | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
239 | | - | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
250 | 262 | | |
251 | 263 | | |
252 | 264 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
| |||
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 281 | | |
354 | 282 | | |
0 commit comments