@@ -30,7 +30,7 @@ import nl.adaptivity.serialutil.impl.maybeAnnotations
30
30
import nl.adaptivity.serialutil.impl.name
31
31
import kotlin.jvm.JvmName
32
32
33
- @Deprecated(" Use the standard library buildSerialDescriptor function" )
33
+ @Deprecated(" Use the standard library buildSerialDescriptor function" , level = DeprecationLevel . ERROR )
34
34
@OptIn(InternalSerializationApi ::class )
35
35
@ExperimentalSerializationApi
36
36
inline fun <reified T > simpleSerialClassDesc (
@@ -42,7 +42,7 @@ inline fun <reified T> simpleSerialClassDesc(
42
42
}
43
43
}
44
44
45
- @Deprecated(" Use the standard library buildSerialDescriptor function" )
45
+ @Deprecated(" Use the standard library buildSerialDescriptor function" , level = DeprecationLevel . ERROR )
46
46
@OptIn(InternalSerializationApi ::class )
47
47
@ExperimentalSerializationApi
48
48
inline fun <reified T > simpleSerialClassDesc (
@@ -77,6 +77,7 @@ inline fun <reified T> simpleSerialClassDesc(vararg elements: Pair<String, KSeri
77
77
}
78
78
79
79
@ExperimentalSerializationApi
80
+ @Deprecated(" Use the standard library buildClassSerialDescriptor function" )
80
81
@JvmName(" simpleSerialClassDescFromSerializer" )
81
82
inline fun <reified T > simpleSerialClassDesc (
82
83
entityAnnotations : List <Annotation >,
@@ -98,6 +99,7 @@ inline fun <reified T> simpleSerialClassDesc(
98
99
),
99
100
DeprecationLevel .HIDDEN
100
101
)
102
+ @OptIn(SealedSerializationApi ::class )
101
103
@ExperimentalSerializationApi
102
104
class SimpleSerialClassDescPrimitive (override val kind : PrimitiveKind , name : String ) : SerialDescriptor {
103
105
override val serialName: String = name
@@ -120,6 +122,7 @@ class SimpleSerialClassDescPrimitive(override val kind: PrimitiveKind, name: Str
120
122
* as well, so exported, but not designed for use outside the xmlutil project.
121
123
*/
122
124
@Deprecated(" This class is no longer needed, it can be replaced by buildSerialDescriptor and buildClassSerialDescriptor" )
125
+ @OptIn(SealedSerializationApi ::class )
123
126
@ExperimentalSerializationApi
124
127
class SimpleSerialClassDesc (
125
128
override val kind : SerialKind = StructureKind .CLASS ,
@@ -162,12 +165,13 @@ class SimpleSerialClassDesc(
162
165
}
163
166
164
167
@ExperimentalSerializationApi
165
- fun SerialDescriptor.withName (name : String ): SerialDescriptor = RenameDesc (this , name)
166
-
167
- @ExperimentalSerializationApi
168
- private class RenameDesc (val delegate : SerialDescriptor , override val serialName : String ) : SerialDescriptor by delegate
168
+ @Deprecated(
169
+ " Use the kotlinx.serialization implementation instead" ,
170
+ ReplaceWith (" SerialDescriptor(name, this)" , " kotlinx.serialization.descriptors.SerialDescriptor" )
171
+ )
172
+ fun SerialDescriptor.withName (name : String ): SerialDescriptor = SerialDescriptor (name, this )
169
173
170
- abstract class DelegateSerializer <T >(val delegate : KSerializer <T >) : KSerializer<T> {
174
+ public abstract class DelegateSerializer <T >(val delegate : KSerializer <T >) : KSerializer<T> {
171
175
override val descriptor: SerialDescriptor get() = delegate.descriptor
172
176
173
177
override fun deserialize (decoder : Decoder ): T = delegate.deserialize(decoder)
0 commit comments