Wallace Jackson

JSON Quick Syntax Reference

Wallace Jackson

Lompoc, California, USA

Any source code or other supplementary materials referenced by the author in this text are available to readers at www.apress.com/9781484218624 . For detailed information about how to locate your book’s source code, go to www.apress.com/source-code/ . Readers can also access source code at SpringerLink in the Supplementary Material section for each chapter.

ISBN 978-1-4842-1862-4

e-ISBN 978-1-4842-1863-1

DOI 10.1007/978-1-4842-1863-1

Library of Congress Control Number: 2016941347

© Wallace Jackson 2016

JSON Quick Syntax Reference

Managing Director: Welmoed Spahr

Lead Editor: Steve Anglin

Technical Reviewer: Ch á d Darby

Editorial Board: Steve Anglin, Pramila Balan, Louise Corrigan, Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Michelle Lowman, James Markham, Susan McDermott, Matthew Moodie, Jeffrey Pepper, Douglas Pundick, Ben Renow-Clarke, Gwenan Spearing

Coordinating Editor: Mark Powers

Copy Editor: Tiffany Taylor

Compositor: SPi Global

Indexer: SPi Global

Artist: SPi Global

For information on translations, please e-mail [email protected] , or visit www.apress.com .

Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales .

Wallace Jackson

Included in front matter

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.

Printed on acid-free paper

Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

This JSON syntax book is dedicated to everyone in the open source community who is working diligently to make professional new media application development software and content-development tools freely available for application developers to use to achieve our creative dreams and financial goals. I also dedicate this book to my father, Parker Jackson, my family, my life-long friends, my content production ranch neighbors, and my business partners, for their continual assistance and those relaxing, beautiful sunset BBQs under pink clouds here on the Point Conception Peninsula.

Introduction

JSON Quick Syntax Reference is intended for individuals who wish to add JSON to their programming quiver. These include application developers, web site developers, user interface design architects, user experience designers, social media application developers, and just about anyone who’s interested in generating superior-quality applications that use JSON to talk to the server from their client-side applications.

This book covers JSON syntax and related concepts; JSON editing; integrated development environments (IDEs) such as NetBeans, IntelliJ, and Eclipse; and how these relate to open source OOP languages such as Java and JavaScript. This equates to JSON syntax, JSON IDE, and OOP fundamentals combined in one book, including technical terms, topics, concepts, and definitions.

Each chapter builds on the knowledge learned in the previous chapter. Thus, later chapters in the book have you creating JSON objects, arrays, and data values using diagrams from the json.org web site, which guide you in making valid data constructs.

At the end of this book, three appendixes explain how to assemble a complete JSON development environment and workstation for each of the three major IDEs, including all related new media content production software packages.

In Chapter 1 , you take a tour of the NetBeans 8.1 IDE, which supports HTML5, JavaScript, CSS, and JSON development inherently in its feature set.

Chapter 2 looks at basic JSON terminology, concepts, and requirements.

Chapter 3 examines at the JSON Schema, which provides a roadmap regarding what JSON supports and how to validate JSON data definitions.

In Chapter 4 , you learn about JSON Object s and the syntax used to create them. The chapter also reviews OOP languages, in an object-oriented programming primer.

In Chapter 5 , you explore JSON arrays and their syntax and learn how to create arrays of data for JSON Object s and JSON Array constructs.

Chapter 6 introduces the supported types of JSON data values you can use to construct JSON Object s and JSON Array s, along with background information regarding these data types and how they are used in popular computer programming languages.

Chapter 7 covers the important JSON String data type and how it is used to create text-based data constructs for JSON Object s and JSON Array s.

Chapter 8 covers the important JSON Number data type and how it is used to represent a wide range of numeric data for JSON Object s and JSON Array constructs.

If you’re interested in creating JSON-compatible computer applications, and you want to learn all the basic JSON syntax and OOP fundamentals as well as how everything works together in the IDE, this is the reference book for you to read to start your journey to JSON mastery. The book is overflowing with tips, tricks, tools, topics, terminology, techniques, concepts, and syntax. JSON Quick Syntax Reference will give you a boost to transition from being a JSON neophyte to being the knowledgeable JSON data definition professional you seek to become, at least where a JSON content production pipeline is concerned.

Acknowledgments

I would like to acknowledge all my fantastic editors and their support staff at Apress, who worked long hours and toiled diligently on this book to make it the very best JSON syntax title currently on the market.

I would like to thank the following people:

Steve Anglin , for his work as the acquisitions editor for the book and for recruiting me to write development titles at Apress covering widely popular open source content-development platforms (Android, Java, JavaFX, HTML5, CSS3, JS, JSON, and so on).

Matthew Moodie , for his work as development editor and for his experience and guidance during the process of making this a fantastic JSON title.

Mark Powers , for his work as the coordinating editor and for his constant diligence in making sure I either hit my chapter-delivery deadlines or far surpassed them.

Chád Darby , for his work as the technical reviewer and for making sure I didn’t make technical mistakes.

Contents

  1. Chapter 1:​ Exploring a JSON Integrated Development Environment
    1. NetBeans 8.​1:​ The Intelligent JSON IDE
      1. NetBeans 8.​1 Is Smart:​ Code Editing in Hyper-Drive
      2. NetBeans 8.​1 Is Extensible:​ Coding in All Languages
      3. NetBeans 8.​1 Is Efficient:​ Project-Management Tool
      4. NetBeans 8.​1 UI Design:​ Responsive Web Design
      5. NetBeans 8.​1 Styling:​ CSS3 Style Editing Support
      6. NetBeans 8.​1 Debugging:​ Squash Those Bugs!
      7. NetBeans 8.​1 Optimization:​ Program Code Profiler
      8. Creating a JSON Project:​ A Bootstrap Project
    2. Summary
  2. Chapter 2:​ An Introduction to JSON:​ Concepts and Terminology
    1. What Is JSON?​
      1. JSON Is Lightweight:​ Simpler Is Usually Superior
      2. JSON Is Text-Based:​ 100% Language Independent
      3. JSON Structures:​ Data Objects and Data Arrays
      4. JSON Is JavaScript Compatible:​ Easy Integration
      5. JSON Open Licensing:​ Free for Commercial Use
    2. Summary
  3. Chapter 3:​ The JSON Schema:​ JSON Structure Validation
    1. JSON Schema:​ Concepts and Definitions
      1. JSON Schema Advantage:​ Clear JSON Description
      2. JSON Hyper-Schema Advantage:​ Links and Forms
    2. JSON Schema Core:​ Language Definition
    3. Summary
  4. Chapter 4:​ Objects and Object-Oriented Programming:​ OOP Primer
    1. Object-Oriented Programming:​ Overview
      1. Java OOP Concepts:​ Hard Object Construction
      2. Java Objects:​ Virtual Reality Using OOP with Java
      3. JavaScript OOP Concepts:​ Hard and Soft Objects
    2. Summary
  5. Chapter 5:​ JSON Arrays:​ Serialized Data Store Structures
    1. An Overview of Arrays:​ Data Structures
      1. Declaring a JavaScript Array:​ Variable Declaration
      2. Accessing a JavaScript Array:​ Using the Index
      3. Defining a JSON Array:​ Using the Colon Operator
    2. Java JSON Support:​ JSON Utility Classes
      1. JSON Object Model:​ Java Object and Array Builder
      2. The JSON Streaming Model:​ Parser and Generator
    3. Summary
  6. Chapter 6:​ JSON Data Values:​ Types of Data that JSON Supports
    1. JSON Value:​ Supported JSON Data Types
      1. String Value:​ The Sequence or Array of Characters
      2. Number Value:​ Representing the World
      3. Boolean Value:​ True or False, On or Off, Yes or No
      4. Null Values:​ A Placeholder for Future Data Values
    2. Java and JavaScript:​ Boolean and Null
    3. Summary
  7. Chapter 7:​ JSON Character Values:​ Defining Strings in JSON
    1. JSON String:​ Unicode Character Support
      1. Background of String Values
      2. Escaping Control Characters:​ JSON Examples
    2. Java and JavaScript:​ Using String Values
      1. Java String Values:​ Java’s String Class and Object
      2. JavaScript String Values:​ Primitives and Objects
    3. Summary
  8. Chapter 8:​ JSON Numeric Values:​ Defining Numbers in JSON
    1. Number Types:​ Integer, Real, Exponential
    2. JSON Number:​ Wide Ranging Numerics
      1. Positive Integers:​ Positive Whole Number Values
      2. Negative Integers:​ Negative Whole Number Values
      3. Positive Real Number Values:​ Positive Fractions
      4. Negative Real Number Values:​ Negative Fractions
      5. Exponential Number Values:​ Scientific Notation
    3. Summary
  9. Appendix A: NetBeans 8.1: Setting Up a JSON Integrated Development IDE
  10. Creating a JSON Development Workstation
  11. Hardware Foundation
  12. Open Source Software
  13. Java 8: Installing the Foundation for NetBeans 8.1
  14. NetBeans 8.1: Downloading the NetBeans JSON IDE
  15. GIMP 2.8: Digital Image Editing and Compositing
  16. Blender: 3D Modeling, Rendering, and Animation
  17. Inkscape: Digital Illustration and Digital Painting
  18. Audacity: Digital Audio Editing and Special Effects
  19. Visual Effects: BlackMagic Design Fusion 8.0 VFX
  20. Digital Video Editing: EditShare Lightworks 12.6
  21. Office Productivity Suite: Apache OpenOffice 4.1.2
  22. Summary
  23. Appendix B: Eclipse Mars: Setting Up a JSON Integrated Development IDE
  24. Creating a JSON Development Workstation
  25. Hardware Foundation
  26. Open Source Software
  27. Java 8: Installing the Foundation for Eclipse Mars
  28. Eclipse 4.5: Installing the Eclipse Mars JSON IDE
  29. GIMP 2.8: Digital Image Editing and Compositing
  30. Blender: 3D Modeling, Rendering, and Animation
  31. Inkscape: Digital Illustration and Digital Painting
  32. Audacity: Digital Audio Editing and Special Effects
  33. Visual Effects: BlackMagic Design Fusion 8.0 VFX
  34. Digital Video Editing: EditShare Lightworks 12.6
  35. Office Productivity Suite: Apache OpenOffice 4.1.2
  36. Summary
  37. Appendix C: IntelliJ IDEA: Setting Up a JSON Integrated Development IDE
  38. Creating a JSON Development Workstation
  39. Hardware Foundation
  40. Open Source Software
  41. Java 8: Installing the Foundation for IntelliJ IDEA
  42. IntelliJ IDEA: Downloading the IntelliJ IDEA for JSON
  43. GIMP 2.8: Digital Image Editing and Compositing
  44. Blender: 3D Modeling, Rendering, and Animation
  45. Inkscape: Digital Illustration and Digital Painting
  46. Audacity: Digital Audio Editing and Special Effects
  47. Visual Effects: BlackMagic Design Fusion 8.0 VFX
  48. Digital Video Editing: Editshare Lightworks 12.6
  49. Office Productivity Suite: Apache OpenOffice 4.1.2
  50. Summary
  51. Index

About the Author and About the Technical Reviewer

About the Author

Wallace Jackson has written for several leading multimedia publications about production for the media content development industry, beginning with an article about advanced computer processing architectures for the centerfold (a removable “mini issue” insert) of the original issue of AV Video Multimedia Producer magazine distributed at the SIGGRAPH trade show.

Wallace has written for a number of popular publications regarding his work in interactive 3D and new media advertising campaign design, including 3D Artist magazine, Desktop Publisher Journal , CrossMedia , Kiosk , AV Video Multimedia Producer , and Digital Signage magazine, as well as many other publications.

Wallace has authored more than 20 Apress book titles, including several in the ever-popular Apress Pro Android series, Java and JavaFX game engine development titles, digital image compositing titles, digital audio editing titles, digital video editing titles, digital illustration titles, VFX special effects titles, digital painting titles, Android 6 new media content production titles, and JSON and HTML5 titles.

In his current book on digital video editing and effects, Wallace focuses on Corel VideoStudio Ultimate X9 digital video software and uses it to demonstrate digital video editing, as well as digital video effects and compositing fundamentals, to beginners who want to become more digital video editing savvy.

Wallace is currently the CEO of MindTaffy Design, a new media advertising agency that specializes in new media content production and digital campaign design and development. The company is located by La Purisima State Park in Northern Santa Barbara County, on the Point Conception Peninsula, halfway between the clientele in Silicon Valley to the north and Hollywood, The OC, West Los Angeles, and San Diego to the south.

MindTaffy Design has created open source, technology-based (HTML5, JavaScript, Java 8, JavaFX 8, and Android 6.0) digital new media i3D content deliverables for more than a quarter century, since January 1991.

The company’s clients consist of a significant number of international brand manufacturers, including IBM, Sony, Tyco, Samsung, Dell, Epson, Nokia, TEAC, Sun Microsystems (Oracle), Micron, SGI, KDS USA, EIZO, CTX International, KFC, Nanao USA, Techmedia, EZC, and Mitsubishi Electronics.

Wallace received his undergraduate BA degree in business economics from the University of California at Los Angeles (UCLA) and his graduate degrees in MIS/IT and business information systems design and implementation from University of Southern California located in South Central Los Angeles (USC).

Wallace also received post-graduate degrees from USC in entrepreneurship and marketing strategy, and he completed the USC Graduate Entrepreneurship Program. Wallace earned his two USC degrees while at USC’s night-time Marshall School of Business MBA Program, which allowed him to work full-time as a COBOL and RPG-II programmer while completing his business and IT degrees.

You can visit Wallace’s blog at www.wallacejackson.com to view his multimedia production content. You can also follow him on Twitter at @wallacejackson or connect with him on LinkedIn.

About the Technical Reviewer

A417940_1_En_BookFrontmatter_Figb_HTML.jpg

Chád (“Shod”) Darby is an author, instructor, and speaker in the Java development world. As a recognized authority on Java applications and architectures, he has presented technical sessions at software development conferences worldwide (in the United States, UK, India, Russia, and Australia). In his 15 years as a professional software architect, he’s had the opportunity to work for Blue Cross/Blue Shield, Merck, Boeing, Red Hat, and a handful of startup companies.

Chád is a contributing author to several Java books, including Professional Java E-Commerce (Wrox Press), Beginning Java Networking (Wrox Press), and XML and Web Services Unleashed (Sams Publishing). Chád has Java certifications from Sun Microsystems and IBM. He holds a BS in computer science from Carnegie Mellon University.

You can visit Chád’s blog at www.luv2code.com to view his free video tutorials on Java. You can also follow him on Twitter at @darbyluvs2code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.45.185