Interface JsonReader.JsonClassReader

All Known Implementing Classes:
RecordFactory.RecordReader
Enclosing class:
JsonReader

public static interface JsonReader.JsonClassReader
Implement this interface to add a custom JSON reader.
Author:
John DeRegnaucourt ([email protected])
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.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    read(Object jsonObj, Resolver resolver)
    Read a custom object.
  • Method Details

    • read

      default Object read(Object jsonObj, Resolver resolver)
      Read a custom object. Only process the non-structural values for any given reader, and push the structural elements (non-primitive fields) onto the resolver's stack, to be processed.
      Parameters:
      jsonObj - Object being read. Could be a fundamental JSON type (String, long, boolean, double, null, or JsonObject)
      resolver - Provides access to push non-primitive items onto the stack for further processing. This will allow it to be processed by a standard processor (array, Map, Collection) or another custom factory or reader that handles the "next level." You can handle sub-objects here if you wanted.
      Returns:
      Java Object that you filled out with values from the passed in jsonObj.