Community
Participate
Working Groups
I20060213-0010 From bug 123470: For consistency, there should be API to get the parent of an IAnnotationBinding or an IMemberValuePairBinding: - IMemberValuePairBinding#getDeclaringAnnotation(): IAnnotationBinding - IAnnotationBinding#getDeclaringBinding(): IBinding (In reply to bug 123470 comment #34) > re:- IMemberValuePairBinding#getDeclaringAnnotation(): IAnnotationBinding > An annotation is homogenous to a paramType or a message send. Arguments are > not connected to the parent container. So I wouldn't add this one. I disagree. An IMemberValuePairBinding has a unique parent, and there should be a query to get that parent. We already have this for all other containment relations, namely ITypeBinding#getPackage() and IType/Variable/MethodBinding#getDeclaringClass/Method(). typeArgument -> parameterizedType and parameterType -> methodBinding are not one-to-one mappings, and therefore it's clear that there's no link to a parent. > re:- IAnnotationBinding#getDeclaringBinding(): IBinding > What is that ? Isn't it a dup of #getAnnotationType() ? No, like IType/Variable/MethodBinding#getDeclaringClass/Method(), this would return the parent binding that has this IAnnotationBinding attached, i.e binding.getAnnotations() would contain the receiver.