Q:

How to get only some attributes from json file?

I have json file which look like this: 
From this json I need to get only total price for each flight. And I need to get number of flights in one way ( thats segments list size ). I have created so many object using http://www.jsonschema2pojo.org/. And with lot of for loops I get necessary  data. But my question is: is there any easier way to get this information's from this json file?
{
  "type": "flight-offer",
  "id": "1549454712606-1539032420",
  "offerItems": [
    {
      "services": [
        {
          "segments": [
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "SJJ",
                  "at": "2019-02-08T06:30:00+01:00"
                },
                "arrival": {
                  "iataCode": "ZAG",
                  "at": "2019-02-08T07:20:00+01:00"
                },
                "carrierCode": "OU",
                "number": "341",
                "aircraft": {
                  "code": "DH4"
                },
                "operating": {
                  "carrierCode": "OU",
                  "number": "341"
                },
                "duration": "0DT0H50M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "K",
                "availability": 3,
                "fareBasis": "KEASY2"
              }
            }
          ]
        },
        {
          "segments": [
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "ZAG",
                  "at": "2019-02-15T14:10:00+01:00"
                },
                "arrival": {
                  "iataCode": "SJJ",
                  "at": "2019-02-15T15:00:00+01:00"
                },
                "carrierCode": "OU",
                "number": "344",
                "aircraft": {
                  "code": "DH4"
                },
                "operating": {
                  "carrierCode": "OU",
                  "number": "344"
                },
                "duration": "0DT0H50M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "U",
                "availability": 9,
                "fareBasis": "UEASY2"
              }
            }
          ]
        }
      ],
      "price": {
        "total": "164.09",
        "totalTaxes": "83.09"
      },
      "pricePerAdult": {
        "total": "164.09",
        "totalTaxes": "83.09"
      }
    }
  ]
},
{
  "type": "flight-offer",
  "id": "1549454712606--1458421402",
  "offerItems": [
    {
      "services": [
        {
          "segments": [
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "SJJ",
                  "at": "2019-02-08T15:10:00+01:00"
                },
                "arrival": {
                  "iataCode": "BEG",
                  "terminal": "2",
                  "at": "2019-02-08T16:00:00+01:00"
                },
                "carrierCode": "JU",
                "number": "113",
                "aircraft": {
                  "code": "AT7"
                },
                "operating": {
                  "carrierCode": "JU",
                  "number": "113"
                },
                "duration": "0DT0H50M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "U",
                "availability": 7,
                "fareBasis": "UNBRBA"
              }
            },
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "BEG",
                  "terminal": "2",
                  "at": "2019-02-08T18:20:00+01:00"
                },
                "arrival": {
                  "iataCode": "ZAG",
                  "at": "2019-02-08T19:35:00+01:00"
                },
                "carrierCode": "JU",
                "number": "234",
                "aircraft": {
                  "code": "AT7"
                },
                "operating": {
                  "carrierCode": "JU",
                  "number": "234"
                },
                "duration": "0DT1H15M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "U",
                "availability": 7,
                "fareBasis": "UNBRBA"
              }
            }
          ]
        },
        {
          "segments": [
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "ZAG",
                  "at": "2019-02-15T10:00:00+01:00"
                },
                "arrival": {
                  "iataCode": "BEG",
                  "terminal": "2",
                  "at": "2019-02-15T11:05:00+01:00"
                },
                "carrierCode": "JU",
                "number": "231",
                "aircraft": {
                  "code": "AT7"
                },
                "operating": {
                  "carrierCode": "JU",
                  "number": "231"
                },
                "duration": "0DT1H5M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "U",
                "availability": 7,
                "fareBasis": "UNBRBA"
              }
            },
            {
              "flightSegment": {
                "departure": {
                  "iataCode": "BEG",
                  "terminal": "2",
                  "at": "2019-02-15T13:50:00+01:00"
                },
                "arrival": {
                  "iataCode": "SJJ",
                  "at": "2019-02-15T14:40:00+01:00"
                },
                "carrierCode": "JU",
                "number": "112",
                "aircraft": {
                  "code": "AT7"
                },
                "operating": {
                  "carrierCode": "JU",
                  "number": "112"
                },
                "duration": "0DT0H50M"
              },
              "pricingDetailPerAdult": {
                "travelClass": "ECONOMY",
                "fareClass": "U",
                "availability": 7,
                "fareBasis": "UNBRBA"
              }
            }
          ]
        }
      ],
      "price": {
        "total": "225.45",
        "totalTaxes": "145.45"
      },
      "pricePerAdult": {
        "total": "225.45",
        "totalTaxes": "145.45"
      }
    }
  ]
}

A:

Your JSON contains two separate objects separated by comma. You need to add brackets:
[{...},{...}]

If you need only price you can read JSON as below:
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(source);

List<JsonNode> prices = node.findValues("price");
for (JsonNode price : prices) {
    System.out.println(price.get("total"));
    System.out.println(price.get("totalTaxes"));
}

EDIT
flighSegment's you can find in similar way:
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(jsonFile);

List<JsonNode> segments = node.findValues("segments");
for (JsonNode segment : segments) {
    List<JsonNode> flightSegments = segment.findValues("flightSegment");
    System.out.println(flightSegments.size());
}

For more info, see:

Working with Tree Model Nodes in Jackson

