langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
changeset 26266 2d24bda701dc
parent 25874 83c19f00452c
child 26781 a786b07c7b91
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Aug 26 12:45:28 2014 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Aug 27 07:44:00 2014 +0200
@@ -41,6 +41,7 @@
 import com.sun.tools.javac.jvm.*;
 import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.Name;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
@@ -572,22 +573,27 @@
         return true;
     }
 
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public Type asType() {
         return type;
     }
 
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public Symbol getEnclosingElement() {
         return owner;
     }
 
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public ElementKind getKind() {
         return ElementKind.OTHER;       // most unkind
     }
 
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public Set<Modifier> getModifiers() {
         return Flags.asModifierSet(flags());
     }
 
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public Name getSimpleName() {
         return name;
     }
@@ -596,13 +602,14 @@
      * This is the implementation for {@code
      * javax.lang.model.element.Element.getAnnotationMirrors()}.
      */
-    @Override
+    @Override @DefinedBy(Api.LANGUAGE_MODEL)
     public List<Attribute.Compound> getAnnotationMirrors() {
         return getRawAttributes();
     }
 
 
     // TODO: getEnclosedElements should return a javac List, fix in FilteredMemberList
+    @DefinedBy(Api.LANGUAGE_MODEL)
     public java.util.List<Symbol> getEnclosedElements() {
         return List.nil();
     }
@@ -645,6 +652,7 @@
         public Symbol asMemberOf(Type site, Types types) { return other.asMemberOf(site, types); }
         public void complete() throws CompletionFailure { other.complete(); }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return other.accept(v, p);
         }
@@ -715,7 +723,7 @@
             return type.hasTag(TYPEVAR);
         }
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public java.util.List<Symbol> getEnclosedElements() {
             List<Symbol> list = List.nil();
             if (kind == TYP && type.hasTag(TYPEVAR)) {
@@ -744,15 +752,17 @@
             super(TYP, flags, name, type, owner);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             return ElementKind.TYPE_PARAMETER;
         }
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public Symbol getGenericElement() {
             return owner;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public List<Type> getBounds() {
             TypeVar t = (TypeVar)type;
             Type bound = t.getUpperBound();
@@ -768,7 +778,7 @@
             }
         }
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public List<Attribute.Compound> getAnnotationMirrors() {
             // Declaration annotations on type variables are stored in type attributes
             // on the owner of the TypeVariableSymbol
@@ -807,7 +817,7 @@
             }
 
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return v.visitTypeParameter(this, p);
         }
@@ -837,10 +847,12 @@
             return fullname.toString();
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Name getQualifiedName() {
             return fullname;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public boolean isUnnamed() {
             return name.isEmpty() && owner != null;
         }
@@ -880,14 +892,17 @@
             return (flags_field & EXISTS) != 0;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             return ElementKind.PACKAGE;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Symbol getEnclosingElement() {
             return null;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return v.visitPackage(this, p);
         }
@@ -1004,6 +1019,7 @@
                 return fullname.toString();
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Name getQualifiedName() {
             return fullname;
         }
@@ -1041,6 +1057,7 @@
             }
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public List<Type> getInterfaces() {
             complete();
             if (type instanceof ClassType) {
@@ -1055,6 +1072,7 @@
             }
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Type getSuperclass() {
             complete();
             if (type instanceof ClassType) {
@@ -1095,6 +1113,7 @@
         }
 
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             long flags = flags();
             if ((flags & ANNOTATION) != 0)
@@ -1107,12 +1126,13 @@
                 return ElementKind.CLASS;
         }
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public Set<Modifier> getModifiers() {
             long flags = flags();
             return Flags.asModifierSet(flags & ~DEFAULT);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public NestingKind getNestingKind() {
             complete();
             if (owner.kind == PCK)
@@ -1144,6 +1164,7 @@
 
 
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return v.visitType(this, p);
         }
@@ -1223,6 +1244,7 @@
             return new VarSymbol(flags_field, name, types.memberType(site, this), owner);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             long flags = flags();
             if ((flags & PARAMETER) != 0) {
@@ -1241,10 +1263,12 @@
             }
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return v.visitVariable(this, p);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Object getConstantValue() { // Mirror API
             return Constants.decode(getConstValue(), type);
         }
@@ -1350,7 +1374,7 @@
             return m;
         }
 
-        @Override
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public Set<Modifier> getModifiers() {
             long flags = flags();
             return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & ~ABSTRACT : flags);
@@ -1612,6 +1636,7 @@
             return new MethodSymbol(flags_field, name, types.memberType(site, this), owner);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             if (name == name.table.names.init)
                 return ElementKind.CONSTRUCTOR;
@@ -1628,22 +1653,27 @@
                     getKind() == ElementKind.INSTANCE_INIT;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Attribute getDefaultValue() {
             return defaultValue;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public List<VarSymbol> getParameters() {
             return params();
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public boolean isVarArgs() {
             return (flags() & VARARGS) != 0;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public boolean isDefault() {
             return (flags() & DEFAULT) != 0;
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
             return v.visitExecutable(this, p);
         }
@@ -1652,14 +1682,17 @@
             return v.visitMethodSymbol(this, p);
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Type getReceiverType() {
             return asType().getReceiverType();
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public Type getReturnType() {
             return asType().getReturnType();
         }
 
+        @DefinedBy(Api.LANGUAGE_MODEL)
         public List<Type> getThrownTypes() {
             return asType().getThrownTypes();
         }