Add jet.deprecated to library

This commit is contained in:
Natalia.Ukhorskaya
2012-10-18 18:59:44 +04:00
parent 11da503c62
commit 1c6b7ed1ae
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -5,6 +5,7 @@ public trait Annotation
public annotation class volatile : Annotation
public annotation class atomic : Annotation
public annotation class data : Annotation
public annotation class deprecated(value: String) : Annotation
public fun <R> synchronized(lock: Any, block : () -> R) : R
@@ -431,6 +431,11 @@ public class KotlinBuiltIns {
return getBuiltInClassByName("volatile");
}
@NotNull
public ClassDescriptor getDeprecatedAnnotation() {
return getBuiltInClassByName("deprecated");
}
@NotNull
public ClassDescriptor getString() {
return getBuiltInClassByName("String");
@@ -831,6 +836,10 @@ public class KotlinBuiltIns {
return containsAnnotation(classDescriptor, getDataClassAnnotation());
}
public boolean isDeprecated(@NotNull DeclarationDescriptor declarationDescriptor) {
return containsAnnotation(declarationDescriptor, getDeprecatedAnnotation());
}
private boolean containsAnnotation(DeclarationDescriptor descriptor, ClassDescriptor annotationClass) {
List<AnnotationDescriptor> annotations = descriptor.getOriginal().getAnnotations();
if (annotations != null) {
+3
View File
@@ -1454,6 +1454,9 @@ public final annotation class jet.atomic : jet.Annotation {
public final annotation class jet.data : jet.Annotation {
public final /*constructor*/ fun <init>(): jet.data
}
public final annotation class jet.deprecated : jet.Annotation {
public final /*constructor*/ fun <init>(/*0*/ value: jet.String): jet.deprecated
}
public final annotation class jet.volatile : jet.Annotation {
public final /*constructor*/ fun <init>(): jet.volatile
}