Jackson Object mapping

JSON/XML object mapping using Jackson

Create List of objects from JSON

ObjectMapper mapper = new ObjectMapper();
String fileName = "dsdm.json";
File json = new File(fileFolder, fileName);

try {
    // start reading from samples tag onwards
    final JsonNode node = mapper.readTree(json).path("samples");
    final CollectionType collectionType = TypeFactory.defaultInstance().constructCollectionType(List.class, TSOSample.class);
    return mapper.readerFor(collectionType).readValue(node);

    } catch (IOException e){
        System.out.println(e.getMessage());
}