AnnotatedType support
まだ誰も着手していません。
評価
調査の方向性
まず ResolvedType と既存の typeParametersFor(List.class) の動作を読み、その後 Java 8 の AnnotatedType および AnnotatedParameterizedType と比較します。解決済みの型パラメーターが関連するアノテーションをどのように公開するかを定義し、適切な互換性スイッチによって Java 7 のサポートを維持します。完了の条件は、例に対して @Null ではなく @NotNull が取得されることです。
索引モデルが issue の本文から書いたものです。
説明
New to Java 8, the AnnotatedType class carries annotations bind to types in Generic expressions.
So if I write
@MaxLength(3) List<@NotNull Integer> myField;
I can get the @NotNull annotation via something like:
Field f = MyClass.class.getDeclaredField("myField");
AnnotatedParameterizedType annType = (AnnotatedParameterizedType) field.getAnnotatedType();
AnnotatedType[] childAnnotatedTypes = annType.getAnnotatedActualTypeArguments();
But then I have to assume the parameter I want is the first in the returned array. But maybe I have something like
class MyFunnyList<T> implements List<@NotNull Integer> {}
// ...
private MyFunnyList<@Null String> myFunnyField;
Using ResolvedType, I can call type.typeParametersFor(List.class).get(0) to get the correct parameter type (Integer rather than String). It'd be nice to have also a way to retrieve the annotations associated with it (@NotNull rather than @Null). Note that this feature must not break support for Java 7, so some type of switch will probably need to be used.
- 主要言語
- Java
- スター
- 266
- フォーク
- 47
- 平均マージ
- 1時間 42分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FasterXML/java-classmate のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
FasterXML/java-classmate#111 · コメント 10 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
FasterXML/java-classmate#81 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
FasterXML/java-classmate#76 · コメント 6 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
FasterXML/java-classmate#72 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
FasterXML/java-classmate#69 · コメント 22 件 ·
FasterXML/java-classmate の issue をすべて見る
似ている issue
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/rocketmq-dashboard#5064 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
wso2/dpdp-accelerator#287 ·