Deserialize annotations on classes

First version, not all kinds of value arguments of annotations are supported
This commit is contained in:
Alexander Udalov
2013-07-04 21:04:53 +04:00
parent 9a33567287
commit 4aeeafdff0
31 changed files with 804 additions and 152 deletions
@@ -0,0 +1,11 @@
package test
annotation class Anno
class Class {
class object {
Anno class Nested
Anno inner class Inner
}
}
@@ -0,0 +1,21 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
internal class object <class-object-for-Class> {
/*primary*/ private constructor <class-object-for-Class>()
test.Anno() internal final inner class Inner {
/*primary*/ public constructor Inner()
}
test.Anno() internal final class Nested {
/*primary*/ public constructor Nested()
}
}
}
@@ -0,0 +1,7 @@
package test
annotation class Anno
class Class {
Anno class object
}
@@ -0,0 +1,13 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
test.Anno() internal class object <class-object-for-Class> {
/*primary*/ private constructor <class-object-for-Class>()
}
}
@@ -0,0 +1,9 @@
package test
deprecated("Class") class Class {
deprecated("Nested") class Nested
deprecated("Inner") inner class Inner
deprecated("class object") class object
}
@@ -0,0 +1,17 @@
package test
jet.deprecated(value = "Class": jet.String) internal final class Class {
/*primary*/ public constructor Class()
jet.deprecated(value = "class object": jet.String) internal class object <class-object-for-Class> {
/*primary*/ private constructor <class-object-for-Class>()
}
jet.deprecated(value = "Inner": jet.String) internal final inner class Inner {
/*primary*/ public constructor Inner()
}
jet.deprecated(value = "Nested": jet.String) internal final class Nested {
/*primary*/ public constructor Nested()
}
}
@@ -0,0 +1,7 @@
package test
annotation class A1
annotation class A2
annotation class A3
A1 A2 A3 class Class
@@ -0,0 +1,17 @@
package test
internal final annotation class A1 : jet.Annotation {
/*primary*/ public constructor A1()
}
internal final annotation class A2 : jet.Annotation {
/*primary*/ public constructor A2()
}
internal final annotation class A3 : jet.Annotation {
/*primary*/ public constructor A3()
}
test.A1() test.A2() test.A3() internal final class Class {
/*primary*/ public constructor Class()
}
@@ -0,0 +1,9 @@
package test
annotation class Anno
class Class {
Anno class Nested
Anno inner class Inner
}
@@ -0,0 +1,17 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
test.Anno() internal final inner class Inner {
/*primary*/ public constructor Inner()
}
test.Anno() internal final class Nested {
/*primary*/ public constructor Nested()
}
}
@@ -0,0 +1,5 @@
package test
annotation class Anno
Anno class X
@@ -0,0 +1,9 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
test.Anno() internal final class X {
/*primary*/ public constructor X()
}
@@ -0,0 +1,20 @@
package test
annotation class IntAnno(val value: Int)
annotation class ShortAnno(val value: Short)
annotation class ByteAnno(val value: Byte)
annotation class LongAnno(val value: Long)
annotation class CharAnno(val value: Char)
annotation class BooleanAnno(val value: Boolean)
annotation class FloatAnno(val value: Float)
annotation class DoubleAnno(val value: Double)
IntAnno(42)
ShortAnno(42)
ByteAnno(42)
LongAnno(42)
CharAnno('A')
BooleanAnno(false)
FloatAnno(3.14)
DoubleAnno(3.14)
class Class
@@ -0,0 +1,53 @@
package test
internal final annotation class BooleanAnno : jet.Annotation {
/*primary*/ public constructor BooleanAnno(/*0*/ value: jet.Boolean)
internal final val value: jet.Boolean
internal final fun <get-value>(): jet.Boolean
}
internal final annotation class ByteAnno : jet.Annotation {
/*primary*/ public constructor ByteAnno(/*0*/ value: jet.Byte)
internal final val value: jet.Byte
internal final fun <get-value>(): jet.Byte
}
internal final annotation class CharAnno : jet.Annotation {
/*primary*/ public constructor CharAnno(/*0*/ value: jet.Char)
internal final val value: jet.Char
internal final fun <get-value>(): jet.Char
}
test.IntAnno(value = 42.toInt(): jet.Int) test.ShortAnno(value = 42.toShort(): jet.Short) test.ByteAnno(value = 42.toByte(): jet.Byte) test.LongAnno(value = 42.toLong(): jet.Long) test.CharAnno(value = #65(A): jet.Char) test.BooleanAnno(value = false: jet.Boolean) test.FloatAnno(value = 3.14.toFloat(): jet.Float) test.DoubleAnno(value = 3.14.toDouble(): jet.Double) internal final class Class {
/*primary*/ public constructor Class()
}
internal final annotation class DoubleAnno : jet.Annotation {
/*primary*/ public constructor DoubleAnno(/*0*/ value: jet.Double)
internal final val value: jet.Double
internal final fun <get-value>(): jet.Double
}
internal final annotation class FloatAnno : jet.Annotation {
/*primary*/ public constructor FloatAnno(/*0*/ value: jet.Float)
internal final val value: jet.Float
internal final fun <get-value>(): jet.Float
}
internal final annotation class IntAnno : jet.Annotation {
/*primary*/ public constructor IntAnno(/*0*/ value: jet.Int)
internal final val value: jet.Int
internal final fun <get-value>(): jet.Int
}
internal final annotation class LongAnno : jet.Annotation {
/*primary*/ public constructor LongAnno(/*0*/ value: jet.Long)
internal final val value: jet.Long
internal final fun <get-value>(): jet.Long
}
internal final annotation class ShortAnno : jet.Annotation {
/*primary*/ public constructor ShortAnno(/*0*/ value: jet.Short)
internal final val value: jet.Short
internal final fun <get-value>(): jet.Short
}
@@ -0,0 +1,5 @@
package test
annotation class Anno(val int: Int, val string: String, val double: Double)
Anno(42, "OK", 3.14) class Class
@@ -0,0 +1,15 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno(/*0*/ int: jet.Int, /*1*/ string: jet.String, /*2*/ double: jet.Double)
internal final val double: jet.Double
internal final fun <get-double>(): jet.Double
internal final val int: jet.Int
internal final fun <get-int>(): jet.Int
internal final val string: jet.String
internal final fun <get-string>(): jet.String
}
test.Anno(double = 3.14.toDouble(): jet.Double, int = 42.toInt(): jet.Int, string = "OK": jet.String) internal final class Class {
/*primary*/ public constructor Class()
}