-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
794ffea
commit 1fc3993
Showing
119 changed files
with
7,612 additions
and
3,561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/commonMain/kotlin/io/github/edmondantes/serialization/annotation/IgnoreDecoder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2023. Ilia Loginov | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.github.edmondantes.serialization.annotation | ||
|
||
import io.github.edmondantes.serialization.decoding.UniqueCompositeDecoder | ||
import io.github.edmondantes.serialization.decoding.UniqueDecoder | ||
import io.github.edmondantes.serialization.encoding.filter.FilterCompositeEncoder | ||
import io.github.edmondantes.serialization.encoding.filter.FilterEncoder | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.SerialInfo | ||
import kotlinx.serialization.encoding.Decoder | ||
|
||
/** | ||
* This annotation ignores encoding for [UniqueDecoder] or [UniqueCompositeDecoder] with an id that is contained in [ignore]. | ||
* Other [Decoder]s will be allowed | ||
* @see FilterEncoder | ||
* @see FilterCompositeEncoder | ||
*/ | ||
@SerialInfo | ||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS) | ||
@OptIn(ExperimentalSerializationApi::class) | ||
public annotation class IgnoreDecoder(val ignore: Array<String> = []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/commonMain/kotlin/io/github/edmondantes/serialization/annotation/SerializationFormat.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2023. Ilia Loginov | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.github.edmondantes.serialization.annotation | ||
|
||
import io.github.edmondantes.serialization.annotation.SerializationFormat.Companion.SELF | ||
import io.github.edmondantes.serialization.encoding.format.FormatEncoder | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.SerialInfo | ||
|
||
/** | ||
* Marks which format [FormatEncoder] should use to serialization | ||
* @param id format's id for serialization. If it is [SELF], encode will use original format | ||
*/ | ||
@SerialInfo | ||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS) | ||
@OptIn(ExperimentalSerializationApi::class) | ||
public annotation class SerializationFormat(val id: String) { | ||
public companion object { | ||
/** | ||
* Marks original format in annotation [SerializationFormat] | ||
*/ | ||
public const val SELF: String = "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.