Replace internal keyword with opt-in annotations
parent
4a2f899a64
commit
25e26f1c62
@ -0,0 +1,14 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
/**
|
||||
* This marker distinguishes the internal API and is used to opt-in for that feature when parsers developing.
|
||||
*
|
||||
* Any usage of a declaration annotated with `@InternalParsersApi` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(InternalParsersApi::class)`,
|
||||
* or by using the compiler argument `-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi`.
|
||||
*/
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@SinceKotlin("1.3")
|
||||
@RequiresOptIn
|
||||
@MustBeDocumented
|
||||
annotation class InternalParsersApi()
|
||||
@ -1,10 +1,11 @@
|
||||
package org.koitharu.kotatsu.parsers.exception
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||
|
||||
/**
|
||||
* Authorization is required for access to the requested content
|
||||
*/
|
||||
class AuthRequiredException(
|
||||
class AuthRequiredException @InternalParsersApi constructor(
|
||||
val source: MangaSource,
|
||||
) : RuntimeException("Authorization required")
|
||||
@ -1,6 +1,8 @@
|
||||
package org.koitharu.kotatsu.parsers.exception
|
||||
|
||||
class ParseException @JvmOverloads constructor(
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
|
||||
class ParseException @InternalParsersApi @JvmOverloads constructor(
|
||||
message: String?,
|
||||
cause: Throwable? = null,
|
||||
) : RuntimeException(message, cause)
|
||||
Loading…
Reference in New Issue