Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
class MyApp {

    // throws if this path shoulddoes not have the required sub-directory structure above
    SearchPath root = new SearchPath("/opt/myapp/my-plastic");

    CartographerWorker worker = new CartographerWorker(root);

    // the schemas directory should have these somewhere: 
    //    my-input-schema-1.0.json
    //    my-output-schema-1.0.json

    VersionedSchema inschema = new VersionedSchema("my-input-schema", "1.0", "json")
    VersionedSchema outschema = new VersionedSchema("my-output-schema", "1.0", "json")

    void handleIncomingPayload(String payload) {
        ...
        String result = worker.translate(inschema, outschema, payload);
        ...
    }
}

...