Java 8 allows things like:
public List<@NonNull String> names;
But is there a way to access this annotation in runtime or is it available only to compiler plugins?
There's new Method#getAnnotatedReturnType
that provides access to annotations on the return type, so I was hoping ParameterizedType
would now have something like getActualAnnotatedTypeArguments
that would do the same for generic type arguments, but it doesn't exist...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…