Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

examples package: Data transformation

The examples package also contains a couple of services that demonstrate how you could transform data using Gloop. These services are stored under the dataTransformation package and are described in the following table:

Service Description
ArrayToSingleObject.gloop Maps an array to a single object.
SingleObjectToArray.gloop Maps a single object to an array.
FileToInputStream.gloop Converts a File to an InputStream.
StringToInputStream.gloop Converts a String to an InputStream.
StringToReader.gloop Converts a String to a Reader.
StringToBlob.gloop Converts a String to a BLOB.
StringToClob.gloop Converts a String to a CLOB.

Like their names imply, these services deal with the conversion of data from one format to another.

Related articles

Please see the following articles for more information:

Try it!

Under the Navigator, expand the examples package and navigate to the code folder. Afterwards, look for the dataTransformation package. This package contains the files and/or directories shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
examples
├── ...
└── code
    └── ...
    └── dataTransformation
        ├── sql
           ├── InsertBlob.gloop
           ├── InsertClob.gloop
           ├── SelectAllBlob.gloop
           ├── SelectBlob.gloop
           └── SelectClob.gloop
        ├── ArrayToSingleObject.gloop
        ├── DatabaseRecordToCSV.gloop
        ├── FileToInputStream.gloop
        ├── SingleObjectToArray.gloop
        ├── StringToBlob.gloop
        ├── StringToClob.gloop
        ├── StringToInputStream.gloop
        └── StringToReader.gloop

The primary services are located directly under the dataTransformation package. These are the services that you should open up or run to see data transformation examples. Each service has been documented to include instructions how to invoke the service, the expected output, and comments on every step.

Explanation

Simple transformations can be done simply by creating map lines between properties using the Mapper view. However, for more complex tasks, a custom strategy might be needed; typically, through method calls.