Here you can find the source of readJsonObject(Path path, TypeReference
public static <T> T readJsonObject(Path path, TypeReference<T> typeReference) throws IOException
//package com.java2s; //License from project: Open Source License import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.nio.file.Path; public class Main { public static <T> T readJsonObject(Path path, TypeReference<T> typeReference) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(path.toFile(), typeReference); }/*from w w w.j av a2 s.co m*/ }