src/share/classes/com/sun/tools/javac/code/Symbol.java

changeset 1521
71f35e4b93a5
parent 1513
cf84b07a82db
child 1541
4cc73ec94686
equal deleted inserted replaced
1520:5c956be64b9e 1521:71f35e4b93a5
82 /** An accessor method for the attributes of this symbol. 82 /** An accessor method for the attributes of this symbol.
83 * Attributes of class symbols should be accessed through the accessor 83 * Attributes of class symbols should be accessed through the accessor
84 * method to make sure that the class symbol is loaded. 84 * method to make sure that the class symbol is loaded.
85 */ 85 */
86 public List<Attribute.Compound> getRawAttributes() { 86 public List<Attribute.Compound> getRawAttributes() {
87 return annotations.getAttributes(); 87 return annotations.getDeclarationAttributes();
88 }
89
90 /** An accessor method for the type attributes of this symbol.
91 * Attributes of class symbols should be accessed through the accessor
92 * method to make sure that the class symbol is loaded.
93 */
94 public List<Attribute.TypeCompound> getRawTypeAttributes() {
95 return annotations.getTypeAttributes();
88 } 96 }
89 97
90 /** Fetch a particular annotation from a symbol. */ 98 /** Fetch a particular annotation from a symbol. */
91 public Attribute.Compound attribute(Symbol anno) { 99 public Attribute.Compound attribute(Symbol anno) {
92 for (Attribute.Compound a : getRawAttributes()) { 100 for (Attribute.Compound a : getRawAttributes()) {
453 public final List<? extends AnnotationMirror> getAnnotationMirrors() { 461 public final List<? extends AnnotationMirror> getAnnotationMirrors() {
454 return getRawAttributes(); 462 return getRawAttributes();
455 } 463 }
456 464
457 /** 465 /**
466 * TODO: Should there be a {@code
467 * javax.lang.model.element.Element.getTypeAnnotationMirrors()}.
468 */
469 public final List<Attribute.TypeCompound> getTypeAnnotationMirrors() {
470 return getRawTypeAttributes();
471 }
472
473 /**
458 * @deprecated this method should never be used by javac internally. 474 * @deprecated this method should never be used by javac internally.
459 */ 475 */
460 @Deprecated 476 @Deprecated
461 public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) { 477 public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) {
462 return JavacElements.getAnnotation(this, annoType); 478 return JavacElements.getAnnotation(this, annoType);
791 807
792 @Override 808 @Override
793 public List<Attribute.Compound> getRawAttributes() { 809 public List<Attribute.Compound> getRawAttributes() {
794 if (completer != null) complete(); 810 if (completer != null) complete();
795 return super.getRawAttributes(); 811 return super.getRawAttributes();
812 }
813
814 @Override
815 public List<Attribute.TypeCompound> getRawTypeAttributes() {
816 if (completer != null) complete();
817 return super.getRawTypeAttributes();
796 } 818 }
797 819
798 public Type erasure(Types types) { 820 public Type erasure(Types types) {
799 if (erasure_field == null) 821 if (erasure_field == null)
800 erasure_field = new ClassType(types.erasure(type.getEnclosingType()), 822 erasure_field = new ClassType(types.erasure(type.getEnclosingType()),
1385 1407
1386 public Attribute getDefaultValue() { 1408 public Attribute getDefaultValue() {
1387 return defaultValue; 1409 return defaultValue;
1388 } 1410 }
1389 1411
1390 public List<VarSymbol> getParameters() { 1412 public List<VarSymbol> getParameters() {
1391 return params(); 1413 return params();
1392 } 1414 }
1393 1415
1394 public boolean isVarArgs() { 1416 public boolean isVarArgs() {
1395 return (flags() & VARARGS) != 0; 1417 return (flags() & VARARGS) != 0;

mercurial