Class JsonFormat

All Implemented Interfaces:
Configuration

public class JsonFormat extends AbstractFormat
解析JSON格式文档 Parsing JSON format documents
Author:
sunweisheng
  • Constructor Details

    • JsonFormat

      public JsonFormat(String jsonContent) throws Exception
      构造函数 Constructor
      Parameters:
      jsonContent - JSON内容 JSON content
      Throws:
      Exception - 父类加载数据时或转化结构时可能抛出异常 Exceptions may be thrown when the parent class loads data or transforms structures
    • JsonFormat

      public JsonFormat(InputStream inputStream) throws Exception
      构造函数 Constructor
      Parameters:
      inputStream - JSON格式文件的流对象 Stream object of JSON format file
      Throws:
      Exception - 父类加载数据时或转化结构时可能抛出异常 Exceptions may be thrown when the parent class loads data or transforms structures
  • Method Details

    • loadData

      protected LinkedHashMap<String,Object> loadData() throws Exception
      加载JSON内容并结构化为LinkedHashMap Load JSON content and structure it as LinkedHashMap
      Specified by:
      loadData in class AbstractFormat
      Returns:
      JSON内容的LinkedHashMap结构 LinkedHashMap structure of JSON content
      Throws:
      Exception - 结构转化时可能会抛出异常 Exceptions may be thrown during structural transformation