Class JsonReader

java.lang.Object
com.cedarsoftware.io.JsonReader

@Deprecated public class JsonReader extends Object
Deprecated.
This class is no longer used. Use JsonIo for JSON parsing.
Legacy class retained only for backward compatibility.

The nested interfaces (JsonReader.ClassFactory, JsonReader.MissingFieldHandler, JsonReader.JsonClassReader) are deprecated and kept only so that existing code referencing JsonReader.ClassFactory etc. continues to compile. New code should use the top-level interfaces directly:

For JSON parsing, use JsonIo:


 // Parse JSON to Java objects
 Person person = JsonIo.toJava(jsonString, readOptions).asClass(Person.class);

 // Parse JSON to Map-of-Maps
 Map map = JsonIo.toMaps(jsonString, readOptions).asClass(Map.class);

 // Parse JSON to a generic type (e.g., List<Person>)
 // Use asType() with TypeHolder to preserve generic type information
 List<Person> people = JsonIo.toJava(jsonString, readOptions)
                              .asType(new TypeHolder<List<Person>>(){});
 
Author:
John DeRegnaucourt (jdereg@gmail.com)
Copyright (c) Cedar Software LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

License

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.