< prev index next >

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

Print this page




1399         @Override
1400         protected <A extends Annotation> A[] getInheritedAnnotations(Class<A> annoType) {
1401 
1402             ClassSymbol sup = getSuperClassToSearchForAnnotations();
1403 
1404             return sup == null ? super.getInheritedAnnotations(annoType)
1405                                : sup.getAnnotationsByType(annoType);
1406         }
1407 
1408 
1409         @DefinedBy(Api.LANGUAGE_MODEL)
1410         public ElementKind getKind() {
1411             apiComplete();
1412             long flags = flags();
1413             if ((flags & ANNOTATION) != 0)
1414                 return ElementKind.ANNOTATION_TYPE;
1415             else if ((flags & INTERFACE) != 0)
1416                 return ElementKind.INTERFACE;
1417             else if ((flags & ENUM) != 0)
1418                 return ElementKind.ENUM;


1419             else
1420                 return ElementKind.CLASS;
1421         }
1422 
1423         @Override @DefinedBy(Api.LANGUAGE_MODEL)
1424         public Set<Modifier> getModifiers() {
1425             apiComplete();
1426             long flags = flags();
1427             return Flags.asModifierSet(flags & ~DEFAULT);
1428         }
1429 
1430         @DefinedBy(Api.LANGUAGE_MODEL)
1431         public NestingKind getNestingKind() {
1432             apiComplete();
1433             if (owner.kind == PCK)
1434                 return NestingKind.TOP_LEVEL;
1435             else if (name.isEmpty())
1436                 return NestingKind.ANONYMOUS;
1437             else if (owner.kind == MTH)
1438                 return NestingKind.LOCAL;




1399         @Override
1400         protected <A extends Annotation> A[] getInheritedAnnotations(Class<A> annoType) {
1401 
1402             ClassSymbol sup = getSuperClassToSearchForAnnotations();
1403 
1404             return sup == null ? super.getInheritedAnnotations(annoType)
1405                                : sup.getAnnotationsByType(annoType);
1406         }
1407 
1408 
1409         @DefinedBy(Api.LANGUAGE_MODEL)
1410         public ElementKind getKind() {
1411             apiComplete();
1412             long flags = flags();
1413             if ((flags & ANNOTATION) != 0)
1414                 return ElementKind.ANNOTATION_TYPE;
1415             else if ((flags & INTERFACE) != 0)
1416                 return ElementKind.INTERFACE;
1417             else if ((flags & ENUM) != 0)
1418                 return ElementKind.ENUM;
1419             else if ((flags & RECORD) != 0)
1420                 return ElementKind.RECORD;
1421             else
1422                 return ElementKind.CLASS;
1423         }
1424 
1425         @Override @DefinedBy(Api.LANGUAGE_MODEL)
1426         public Set<Modifier> getModifiers() {
1427             apiComplete();
1428             long flags = flags();
1429             return Flags.asModifierSet(flags & ~DEFAULT);
1430         }
1431 
1432         @DefinedBy(Api.LANGUAGE_MODEL)
1433         public NestingKind getNestingKind() {
1434             apiComplete();
1435             if (owner.kind == PCK)
1436                 return NestingKind.TOP_LEVEL;
1437             else if (name.isEmpty())
1438                 return NestingKind.ANONYMOUS;
1439             else if (owner.kind == MTH)
1440                 return NestingKind.LOCAL;


< prev index next >