Articles Tagged ‘filter’

Transforming JSON Structures with Java and JOLT

Sunday, January 29th, 2017

When it comes to web-services (especially RESTful web-services), configuration files or other data-descriptors, the JavaScript Object Notation, short: JSON is often used as format of choice.

As the task arises to transform these JSON structures, I have seen a variety of different approaches from converting JSON into XML using JAX-B, applying XSLT,  transforming into JSON again on the one hand to loading JSON structures into Hash-maps of Hash-maps (..) and manually removing single elements from these collections on the other hand.

JOLT is a library to make this task easier for us: It allows us to note down different types of transformations in a specification file in JSON syntax and to apply this specification to given JSON structures with ease.

In the following short tutorial I’d like to demonstrate how to use this library by transforming JSON structures programmatically with a few lines of code, by filtering a RESTful web-service using JOLT and a servlet filter and finally by adding a short example using the Apache Camel framework.

(more…)

Unix-like data pipelines with Java 8 Streams and UStream

Sunday, November 8th, 2015

We all love the simplicity when chaining commands and pipes in an Unix derivative environment.

UStream takes this approach and extends Java 8′s stream API to mimic some of the well known commands and apply them on streams.

In the following tutorial, I’d like to share some slim examples for using UStream.

(more…)

JAX-RS 2.0 REST Client Features by Example

Monday, December 30th, 2013

JAX-RS 2.0 aka JSR 339 not also specifies the API to build up a RESTful webservice but also enhances the client side API to easen up the process of writing a client for a REST service.

In the following tutorial we’re building up a client for a ready-to-play REST service and explore the different new options e.g. how to handle requests in a synchronous or asynchronous way, how to add callback handlers for a request, how to specify invocation targets to build up requests for a later execution or how to filter the client-server communication using client request filters and client response filters.

(more…)

Playing with Java 8 Lambda Expressions

Sunday, September 22nd, 2013

Many articles have been written about JSR 335 aka Lambda Expressions for the JavaTM Programming Language but I like to try new things out for myself and that’s why I’d like to share my snippets here.

(more…)

Search
Categories