1 11 package org.eclipse.jdt.internal.compiler.lookup; 12 13 public class UnresolvedAnnotationBinding extends AnnotationBinding { 14 private LookupEnvironment env; 15 private boolean typeUnresolved = true; 16 17 UnresolvedAnnotationBinding(ReferenceBinding type, ElementValuePair[] pairs, LookupEnvironment env) { 18 super(type, pairs); 19 this.env = env; 20 } 21 22 public ReferenceBinding getAnnotationType() { 23 if (this.typeUnresolved) { this.type = BinaryTypeBinding.resolveType(this.type, this.env, false); 25 this.typeUnresolved = false; 27 } 28 return this.type; 29 } 30 31 public ElementValuePair[] getElementValuePairs() { 32 if (this.env != null) { 33 if (this.typeUnresolved) { 34 getAnnotationType(); } 36 for (int i = this.pairs.length; --i >= 0;) { 38 ElementValuePair pair = this.pairs[i]; 39 MethodBinding[] methods = this.type.getMethods(pair.getName()); 40 if (methods != null && methods.length == 1) { 42 pair.setMethodBinding(methods[0]); 43 } Object value = pair.getValue(); 45 if (value instanceof UnresolvedReferenceBinding) { 46 pair.setValue(((UnresolvedReferenceBinding) value). 47 resolve(this.env, false)); 48 } } 52 this.env = null; 53 } 54 return this.pairs; 55 } 56 } 57 | Popular Tags |