Class AbstractFormat

java.lang.Object
com.bluersw.analyze.AbstractFormat
All Implemented Interfaces:
Configuration
Direct Known Subclasses:
EmptyFormat, JsonFormat, YamlFormat

public abstract class AbstractFormat extends Object implements Configuration
分析文件内容抽象类 Analysis file content abstract class
Author:
sunweisheng
  • Field Details

  • Constructor Details

    • AbstractFormat

      public AbstractFormat(String content) throws Exception
      构造函数 Constructor
      Parameters:
      content - 文件内容 document content
      Throws:
      Exception - 结构化数据时可产生异常 Exceptions can occur when structuring data
    • AbstractFormat

      public AbstractFormat(InputStream inputStream) throws Exception
      构造函数 Constructor
      Parameters:
      inputStream - 文件的输入流对象 File input stream object
      Throws:
      Exception - 读取流数据或结构化数据时可产生异常 Exceptions can occur when reading streaming data or structured data
  • Method Details

    • loadData

      protected abstract LinkedHashMap<String,Object> loadData() throws Exception
      加载文件中的数据,并转化LinkedHashMap结构 Load the data in the file and convert LinkedHashMap structure
      Returns:
      LinkedHashMap 结构数据 LinkedHashMap structure data
      Throws:
      Exception - 读取数据或结构化数据时可产生异常 Exceptions can occur when reading data or structured data
    • getValueListBySearch

      public List<String> getValueListBySearch(String searchCommand)
      实现Configuration接口,通过搜索命令检索索引中的数据并返回结果列表 Implement the Configuration interface, retrieve the data in the index through the search command and return the result list
      Specified by:
      getValueListBySearch in interface Configuration
      Parameters:
      searchCommand - 搜索命令,格式类似XPath语法,以"//"开始每层用"/"分割开 Search command, the format is similar to XPath syntax, starting with "//" and separating each layer with "/"
      Returns:
      搜索结果列表 Search result list