Coder Social home page Coder Social logo

transparency-information-language / java-tilt Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 90 KB

java-tilt is a Java based language binding for the Transparency Information Language and Toolkit.

License: MIT License

Java 100.00%
transparency-enhancing-technologies java gdpr tilt java-tilt transparency-information-language language-binding

java-tilt's Introduction

Java CI with Maven Maven Package

java-tilt

java-tilt is a Java based language binding for the Transparency Information Language and Toolkit.

Installation

1/2: Add this to pom.xml:

<dependency>
  <groupId>cloud.implementation.tilt</groupId>
  <artifactId>tilt</artifactId>
  <version>0.0.1</version>
</dependency>

2/2: Run via command line:

$ mvn install

Usage

See more examples and tests here.

/*
    Generate new Tilt instance from scratch
 */

Tilt tilt = new Tilt();

Controller controller = new Controller();
controller.setName("Example Company SE");
tilt.setController(controller);

System.out.println(tilt.toString());
/*
    Validation Example
*/

String DOCUMENT_URL = "https://raw.githubusercontent.com/Transparency-Information-Language/schema/master/tilt.json";

TiltValidator.validateDocumentFromUrl(DOCUMENT_URL);
/*
    Load tilt instance from json and modify properties
*/
try {
    String instance = IOUtils.toString(URI.create(DOCUMENT_URL), "utf8");

    System.out.println(instance.indexOf("meta"));

    Tilt t = Converter.fromJsonString(instance);
    System.out.println(t.getMeta().getHash());
    t.getMeta().setHash("42");

    System.out.println(Converter.toJsonString(t));

    System.out.println(t.getMeta().toString());
    System.out.println(t.toString());

} catch (IOException e) {
    e.printStackTrace();
}

Author

Elias Grünewald

License

MIT License

java-tilt's People

Contributors

eliasgruenewald avatar playacem avatar tomijange avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

java-tilt's Issues

Library is unusable in every project

The library files are all inside the default package making it impossible to import from outside the default package. The example does not encounter the problem at the moment, as it is also using the default package.

The standard recommended approach is to use a reversed domain under the authors control as the base, e.g. something like com.example.lib.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.