Skip to content

JsonReader

Reflxction edited this page Aug 19, 2019 · 5 revisions

Page Index:


Introduction

JsonReader is the base for any file reading process done in MoltenJSON. Although JsonReader has convenient methods to handle JSON data through deserializing, it's not as feature-rich, safe-to-use and human-friendly as configurations, hence it's discouraged to use it, and use appropriate configurations instead.

Construction

JsonReader comes with 2 special constructors each serving a different and concurrent purpose, overloaded with 2 other sub-constructors for each:

  • JsonReader(JsonFile file, boolean locked):

    • file: The JsonFile to read from.
    • locked: Whether should the reader have its aforementioned JsonFile mutable. If true, any calls to #setFile() will result in an exception.
    • Overloaded constructor: JsonReader(JsonFile file, locked -> false)

  • JsonReader(BufferedReader reader, boolean locked):

    • reader: A specifically-initiated reader, set by the developer, which will be used for all parsing.
    • locked: Whether should the reader have its aforementioned JsonFile mutable. If true, any calls to #setFile() will result in an exception.
    • Overloaded constructor: JsonReader(BufferedReader reader, locked -> false)

Clone this wiki locally