commonMain.at.asitplus.jsonpath.JsonPathFunctionExtensionRepository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonpath4k Show documentation
Show all versions of jsonpath4k Show documentation
Kotlin Multiplatform library for using Json Paths as specified in [RFC9535](https://datatracker.ietf.org/doc/rfc9535/)
The newest version!
package at.asitplus.jsonpath
import at.asitplus.jsonpath.core.JsonPathFunctionExtension
/**
* This class is not specified in the rfc standard, it's but an implementation detail.
* It's a way to provide users with a way to add custom function extensions.
*/
interface JsonPathFunctionExtensionRepository {
/**
* Implementations should throw FunctionExtensionCollisionException if an extension with that name already exists.
*/
fun addExtension(name: String, extension: () -> JsonPathFunctionExtension<*>)
fun getExtension(name: String): JsonPathFunctionExtension<*>?
fun export(): Map>
}
open class FunctionExtensionCollisionException(message: String) : Exception(message)