No description
  • Kotlin 96.2%
  • ANTLR 3.8%
Find a file
2026-09-19 22:10:17 +02:00
.ai Add .ai/ documentation guides for multiple modules 2026-08-04 16:33:14 +02:00
.github/workflows fix: push bump commit to master via HEAD:master, stay on tag checkout 2026-09-19 21:05:37 +02:00
core fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:52 +02:00
gradle Merge pull request #56 from Mallne/renovate/ktor-monorepo 2026-09-19 20:03:59 +02:00
tokenizer fix: restore findProperty for -PVERSION_NAME CI override to work 2026-09-19 20:21:52 +02:00
.dockerignore Remove server module, translation-keys plugin, and update build configuration. 2025-07-15 15:23:36 +02:00
.gitignore Refactor and modularize Weaver AST and grammar definitions. 2025-07-20 13:16:24 +02:00
AGENTS.md Add .ai/ documentation guides for multiple modules 2026-08-04 16:33:14 +02:00
build.gradle.kts Align Dependencies and better support for JS Target 2026-03-17 23:17:51 +01:00
gradle.properties feat: add snapshot/release workflows, version from gradle.properties, Nexus in settings 2026-09-19 20:04:07 +02:00
gradlew fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:51 +02:00
gradlew.bat fix: proper gradle wrapper, conditional signing, updated workflows 2026-09-19 10:10:51 +02:00
LICENSE Remove server module, translation-keys plugin, and update build configuration. 2025-07-15 15:23:36 +02:00
README.md Add Readme and Agents Files 2026-03-19 21:40:13 +01:00
renovate.json fix: use regex allowedVersions to filter cloud.mallne to stable only 2026-09-19 22:10:17 +02:00
settings.gradle.kts feat: add snapshot/release workflows, version from gradle.properties, Nexus in settings 2026-09-19 20:04:07 +02:00

DiCentra Weaver

DiCentra Kotlin License Kotlin Multiplatform

DiCentra Weaver is a powerful, schema-driven transformation framework designed to map and process JSON data using a specialized expression language. Built with Kotlin Multiplatform, it provides a consistent transformation engine across JVM, Android, iOS, JS, and Wasm targets.

Features

  • Schema-Driven Transformations: Define your data mapping rules in a structured schema.
  • Weaver Object Language (WOL): A rich expression language for dynamic data access and computation.
  • Kotlin Multiplatform: Run the same transformation logic on any platform.
  • Extensible Architecture: Easily add custom functions and plugins.
  • High Performance: Efficiently handles complex JSON structures.

Installation

Add the dependency to your build.gradle.kts:

implementation("cloud.mallne.dicentra.weaver:core:1.0.0-SNAPSHOT")

Weaver Object Language (WOL)

WOL is the core of Weaver's transformation capabilities. It comes in two flavors: Accessor WOL for path traversal and Computation WOL for logic and arithmetic.

1. Accessor WOL

Used to navigate JSON structures and interpolate values.

Example Description
user.id Accesses the id field of the user object.
items[0] Accesses the first element of the items array.
{otherSchema.id} Interpolates a value from another schema.
{#transform#} Calls a LimboObject (a named transformation).
{##param##} Accesses a parameter passed to the transformation.
{|#val#|i|} Coerces the result of {#val#} to an integer.

2. Computation WOL

Used for logic, arithmetic, and more complex transformations.

Category Examples
Arithmetic 1 + 2, (10 * {price}) / 2, 5 % 2
Logic true && {isAdmin}, !{isBlocked}, (5 > 2) || false
Comparison {age} >= 18, 'admin' == {role}, 5 != 10
Ternary {score} > 50 ? 'Pass' : 'Fail'
Elvis Operator {name} ?: 'Anonymous'
Coercion |{count}|s| (ToString), |'true'|b| (ToBoolean)
Functions pow(2, 8), max({a}, {b})

Usage Example

val weaver = Weaver()
val schema = WeaverSchema(
    key = "userProfile",
    root = PropertyDeclaration(
        content = "{#transformedUser#}"
    ),
    transforms = listOf(
        LimboObjectDeclaration(
            name = "transformedUser",
            // Define your transformation logic here
        )
    )
)

val engine = weaver.engine(schema)
val result = engine.execute<UserProfile>(inputJson)

Module Overview

  • core: The main execution engine and schema model.
  • tokenizer: ANTLR-based parser for the Weaver Object Language.

License

This project is licensed under the Apache License 2.0. See LICENSE for details.


Built with ❤️ by Mallne under the DiCentra umbrella