Learn HOW TO PARSE JSON IN JAVA: A Quick Guide
Автор: Begin Secure
Загружено: 2022-03-25
Просмотров: 460
Описание:
When you want to know how to parse JSON in Java, there are so many different libraries to select from. What are the different solutions? Show me a quick example with code samples and what are the application security issues I should be aware of for parsing JSON?
#IT #Development #SoftwareDevelopment #JavaProgramming #JavaTutorial #AppplicationSecurity #AppSec #appsecurity #informationsecurity #infosec
Chapters
00:00 Introduction
00:25 Overview of video
01:39 What is JSON
02:57 JSON Example
03:28 Picking a parsing library
04:46 Code the solution
07:39 Adding the library to Maven pom
11:03 Discussion of application security
So the question we address in this video is: How can we parse JSON in Java.
This is a great question and we could spend hours discussing the nuances of this topic.
In this video, we’ll present a JSON file or document, discuss the format and pull out some the data elements in an example Java application
First, let’s talk about JSON.
What is it?
JSON stands for Javascript Object Notation
it’s a language independent data format that we can use to express objects as a human readable list of properties
The data format represents an object as a curly brace delimited set, with a comma separated list of properties in between to represent the properties and state of the object
For each property, the name is expressed as a double quoted string
The property string name is followed by a colon character which is followed by the value of the property which is in one of the allowed JSON types
The supported types are number, string, Boolean, array, object and null
Numbers are unadorned by any punctuation such as double quotes, so you will see a number by itself
A string will be surrounded by double quotes
A boolean will be either true or false
Null will be the word null
An opening and closing set of curly braces represents a JSON object
And finally an array is represented by an opening and closing set of square brackets
Of course an object or array can be nested and contain additional objects and arrays so a JSON object can be quite complex
Let’s take a look at a short example JSON object.
A few things to note about this object
First you’ll see it is an anonymous object meaning it does not have a name in double quotes followed by a colon before the opening curly brace
The overall object has 4 properties.
They include 2 strings: firstname and lastname
Age which is a number
And another object called address
Notice address is not an anonymous object since it has a name, a colon and then a set of curly braces
Within the address object, we see 4 properties.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: