zh_cn:tutorial:accesswideners
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
zh_cn:tutorial:accesswideners [2021/10/25 10:13] – [Specifying file location] solidblock | zh_cn:tutorial:accesswideners [2021/10/25 10:14] (current) – [Access Wideners] solidblock | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | Access wideners(访问加宽)提供了一种放宽类、方法、字段访问权限的方式。Access wideners | + | 访问加宽(Access wideners)提供了一种放宽类、方法、字段访问权限的方式。访问加宽类似于著名的 Access Transformers. |
- | Access wideners | + | 访问加宽应该**仅在**使用 Mixin 无法实现时使用。目前只有以下两种情景 Mixin 无法做到: |
* 需要访问一个(包内)的私有类,尤其是为了 @Shadow 修饰或在 Mixin 类内访问一个字段或方法。 | * 需要访问一个(包内)的私有类,尤其是为了 @Shadow 修饰或在 Mixin 类内访问一个字段或方法。 | ||
* 需要重写使用 final 修饰的子类。 | * 需要重写使用 final 修饰的子类。 |
zh_cn/tutorial/accesswideners.1635156793.txt.gz · Last modified: 2021/10/25 10:13 by solidblock