bean.prop1.prop2
ゲッター/フィールド自体の注釈へのアクセスを許可しながら、プロパティアクセスのような BeanUtils を利用できる Java ライブラリはありますか?
たとえば、次のような Bean クラスがあります。
public class Child {
@SomeCustomAnnotation
private String name;
//standard bean getter setters
}
public class Parent {
private Child child;
//standard bean getter setters
}
そして、探しているプロパティの値だけでなく、値が返されているそのフィールドに注釈が付けられた注釈も取得できるようにしたいと考えています。
String childsName = SomeLibrary.getValue(parent, "child.name");
Annotation[] annotationsOnChildsName = SomeLibrary.getAnnotations(parent, "child.name");
両方の機能を使用できるライブラリはありますか? Commons BeanUtils を使用して値の純粋なプロパティ アクセスを行い、Plain Reflection を使用してプロパティの注釈を取得できますが、両方の機能を組み合わせる方法はないようです。