• Modules
    • By category
    • By name
    • Most popular
    • Most downloaded
    • Repository
  • Register
  • Log in
  • Help
    • Start using Ceylon Herd
    • Publish your first module
    • Module publishing guidelines
    • All about Ceylon
    • Keyboard Shortcuts

    • s Focus search module bar
      ? Open this information panel
      j Move selection down
      k Move selection up
      enter Open current selection
Module info
Name
Voitech / herd.gecon.core.engine
Description

Core engine module for Gecon framework. Provides Gecon class to be instantiated, as main entry point for executing of transformations. Setup is done via herd.gecon.core.engine.configuration::Configuration class instance. Use Ceylon builder pattern for readable initiaiation. All transformation are provided via Provider instances. Example:

value gecon = Gecon { 
    provider = AutoProvider{ 
        transformations = ScopeProvisioning{
            scopes=[
            `module herd.gecon.core.transformer`,
            `module herd.gecon.collection.transformer`
            `module herd.gecon.json.transformer`
            ];
        };
    };
    configuration = Configuration{
        logging = Logging(info);
    };
}; 

Example instance provides all required transformations for generic object conversion, collection conversions, json <-> model conversions. Be aware that defined model must be annotated shared. All attributes must be also annotated shared. Until further release it must be also annotated serializable. Example generic model conversion using provided gecon instance:

    shared serializable class SomeModel(shared String one,
        shared Integer two,
        shared Float three){}
    shared serializable class OtherModel(shared Integer one,
        shared String two,
        shared Boolean three){}

    void run(){
        value someModel = SomeModel("1",2,"1.0"); 
        assert(is OtherModel result=gecon.transform(someModel,`OtherModel`);
        assert(result.one==1);
        assert(result.two=="2");
        assert(result.three==true);
    }

For more examples take a look on examples source folder.

Last Published May 27, 2019
Stats Downloads (JVM): 106
Downloads (JS): 26
Source downloads: 109
Module links Imported By
Browse
List of published versions
0.0 JVM JavaScript JVM: 1.2.x, 1.3.x (latest) JavaScript: Unknown (10/0) Published May 27, 2019 Browse
View docs
You must be logged in to comment.

Ceylon Herd v1.24 Copyright 2012-2022 Red Hat. About