--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Attribute.java Tue Aug 26 12:45:28 2014 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Attribute.java Wed Aug 27 07:44:00 2014 +0200
@@ -33,6 +33,7 @@
import javax.lang.model.type.DeclaredType;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.DefinedBy.Api;
/** An annotation value.
*
@@ -52,10 +53,12 @@
public abstract void accept(Visitor v);
+ @DefinedBy(Api.LANGUAGE_MODEL)
public Object getValue() {
throw new UnsupportedOperationException();
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
throw new UnsupportedOperationException();
}
@@ -74,12 +77,15 @@
super(type);
this.value = value;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
return Constants.format(value, type);
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public Object getValue() {
return Constants.decode(value, type);
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
if (value instanceof String)
return v.visitString((String) value, p);
@@ -121,12 +127,15 @@
types.syms.classType.tsym,
Type.noAnnotations);
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
return classType + ".class";
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public Type getValue() {
return classType;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
return v.visitType(classType, p);
}
@@ -183,6 +192,7 @@
* @com.example.foo
* Omit parens for marker annotations, and omit "value=" when allowed.
*/
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("@");
@@ -218,18 +228,22 @@
return null;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public Attribute.Compound getValue() {
return this;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
return v.visitAnnotation(this, p);
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public DeclaredType getAnnotationType() {
return (DeclaredType) type;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public Map<MethodSymbol, Attribute> getElementValues() {
Map<MethodSymbol, Attribute> valmap = new LinkedHashMap<>();
for (Pair<MethodSymbol, Attribute> value : values)
@@ -272,6 +286,7 @@
}
public void accept(Visitor v) { v.visitArray(this); }
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append('{');
@@ -285,9 +300,11 @@
buf.append('}');
return buf.toString();
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public List<Attribute> getValue() {
return List.from(values);
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
return v.visitArray(getValue(), p);
}
@@ -310,12 +327,15 @@
this.value = Assert.checkNonNull(value);
}
public void accept(Visitor v) { v.visitEnum(this); }
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
return value.enclClass() + "." + value; // qualified name
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public VarSymbol getValue() {
return value;
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
return v.visitEnumConstant(value, p);
}
@@ -326,12 +346,15 @@
super(type);
}
public void accept(Visitor v) { v.visitError(this); }
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String toString() {
return "<error>";
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public String getValue() {
return toString();
}
+ @DefinedBy(Api.LANGUAGE_MODEL)
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
return v.visitString(toString(), p);
}