In this post of JQuery, I will show how to select elements using class selector. Class selector is used to retrieve elements whose class attribute’s value matches with the one specified in the selector. Class selector also selects elements whose class attribute’s value have multiple class name and one of them matches with the one…… Continue reading Selecting elements using Class selector
Reading from multiple files using MultiResourceItemReader
In this post of Spring Batch, I will explain how to read from multiple files. We take the help of org.springframework.batch.item.file.MultiResourceItemReader, it reads from multiple file. The MultiResourceItemReader takes two arguments 1) list of resources or pattern followed by the multiple source files, from which the data has to be read 2) Reference to reader…… Continue reading Reading from multiple files using MultiResourceItemReader
UnMarshalling YAML file to Java Object
This post explains unmarshalling information stored in YAML format to java object . This can be achieved with the help of YAMLMapper provided by jackson package. To explain with an example we will use the below pojo objects Employee package package2; import java.math.BigDecimal; import java.util.List; public class Employee { private String id; private String name;…… Continue reading UnMarshalling YAML file to Java Object
Marshalling Java Object to YAML format
This post explains marshalling a java object to YAML format and storing it to a file. This can be achieved with the help of YAMLMapper provided by jackson package. To explain with an example we will use the below pojo objects. Employee package package2; import java.math.BigDecimal; import java.util.List; public class Employee { private String id;…… Continue reading Marshalling Java Object to YAML format
Creating a YAML file
The below post explains how to write YAML data to file using YAMLGenerator. YAMLGenerator writes the data to a file in streaming way, helping the developer using the api to avoid creating an object representation of the entire data. We can get an instance of YAMLGenerator with the help of an instance of YAMLFactory as…… Continue reading Creating a YAML file
Parsing a YAML file
In this post I will explain how to parse a YAML file using Jackson framework. We need the following jars in our classpath 1) jackson-dataformat-yaml-2.9.6.jar 2) snakeyaml-1.18.jar 3) jackson-annotations-2.9.0.jar 4) jackson-core-2.9.6.jar 5) jackson-databind-2.9.6.jar First we need to create an instance of YAMLFactory class. It is factory class used to create instance of YAMLParser (reader) and…… Continue reading Parsing a YAML file
Selecting particular element using ID selector
In this post of JQuery, I will introduce you to id selector. The syntax of id selector is particular element’ attribute id value prepended by ‘#’ symbol, for eg #button. It is used to select one particular element whose id matches the id given in the $ method. Below is an example 1 <html> 2…… Continue reading Selecting particular element using ID selector
Universal Selector *
In this post of JQuery, I will introduce you to universal selector, represented by * symbol. It is used to select all the elements in the html page. Below is an example 1 <html> 2 <head> 3 https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js 4 </head> 5 <body> 6 7 function selectAll() { 8 var $all = $(‘*’); 9 alert($all); 10…… Continue reading Universal Selector *
Writting to multiple files using MultiResourceItemWriter
In this post of Spring Batch, I will explain how to write the records read, to multiple files instead of one. We take the help of MultiResourceItemWriter, it writes to multiple file and suffixes the output fileNames with an index. For example if the file name to be created, is DemoData.txt and two files are…… Continue reading Writting to multiple files using MultiResourceItemWriter
Filtering items using ItemProcessor
In Spring Batch, items are read from the source using reader and written to destination using a writer. Sometimes, we need to add business logic between the reader and writer for the following purpose 1) Filtering an item 2) Converting an item read from one format to another before written to the destination 3) Modify…… Continue reading Filtering items using ItemProcessor