Skip to content

disaster1-tesk/J2J

J2J - Java to JSON Transformation Library

License Java 8+ Maven Docker

J2J is a powerful Java-based JSON transformation library designed to provide flexible and extensible tools for manipulating JSON data. Built on the principles of the popular JOLT library, J2J offers enhanced capabilities for data integration and transformation pipelines.

Try the online web interface to experiment with JSON transformations without installing anything!

🚀 Quick Start

Maven Dependency

<dependency>
    <groupId>love.disaster</groupId>
    <artifactId>j2j-core</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Simple Usage

// Create a transformation specification
Object spec = JsonUtils.jsonToObject("{ \"*\": \"&\" }");

// Create a Chainr instance
Chainr chainr = Chainr.fromSpec(spec);

// Transform JSON data
Object input = JsonUtils.jsonToObject("{ \"foo\": \"bar\" }");
Object output = chainr.transform(input);

// Convert back to JSON string
String result = JsonUtils.toJsonString(output);

📚 Documentation

🛠️ Key Features

  • Multiple Transformation Operations: Shift, Default, Remove, Sort, and Chain operations
  • Declarative Specifications: Define transformations using JSON specifications
  • Command-Line Interface: Use transformations directly from the terminal
  • Web Interface: Interactive web-based transformation tool at http://www.disaster.love/j2j/
  • Extensible Architecture: Create custom transformations and functions
  • Template Engine Integration: Support for Beetl and JSONata expressions
  • Comprehensive Validation: Built-in JSON and specification validation
  • Performance Optimized: Efficient processing for large JSON documents
  • Docker Support: Containerized deployment for easy distribution

📦 Modules

Module Description
j2j-core Core transformation logic and utilities
j2j-cli Command-line interface for JSON transformations
j2j-complete Factory classes for transformation chains
j2j-dependencies Centralized dependency management
j2j-web Web interface for interactive JSON transformations

🚀 Try It Online

Experiment with JSON transformations without installing anything:

👉 http://www.disaster.love/j2j/

🐳 Docker Deployment

# Build the project
mvn clean package -DskipTests

# Build the Docker image
docker build -t j2j-web:latest .

# Run the container
docker run -p 8080:8080 j2j-web:latest

📖 Learning Resources

🏗️ Building from Source

# Clone the repository
git clone https://github.com/your-username/j2j.git
cd j2j

# Build the entire project
mvn clean install

# Run tests
mvn test

# Package for distribution
mvn package

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🙏 Acknowledgments

About

JSON to JSON

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published