Package com.bluersw.analyze
Class AbstractFormat
java.lang.Object
com.bluersw.analyze.AbstractFormat
- All Implemented Interfaces:
Configuration
- Direct Known Subclasses:
EmptyFormat,JsonFormat,YamlFormat
分析文件内容抽象类 Analysis file content abstract class
- Author:
- sunweisheng
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected LinkedHashMap<String, Object> protected final LinkedHashMap<String, String> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFormat(InputStream inputStream) 构造函数 ConstructorAbstractFormat(String content) 构造函数 Constructor -
Method Summary
Modifier and TypeMethodDescriptiongetValueListBySearch(String searchCommand) 实现Configuration接口,通过搜索命令检索索引中的数据并返回结果列表 Implement the Configuration interface, retrieve the data in the index through the search command and return the result listprotected abstract LinkedHashMap<String, Object> loadData()加载文件中的数据,并转化LinkedHashMap结构 Load the data in the file and convert LinkedHashMap structure
-
Field Details
-
-
index
-
data
-
-
Constructor Details
-
AbstractFormat
构造函数 Constructor- Parameters:
content- 文件内容 document content- Throws:
Exception- 结构化数据时可产生异常 Exceptions can occur when structuring data
-
AbstractFormat
构造函数 Constructor- Parameters:
inputStream- 文件的输入流对象 File input stream object- Throws:
Exception- 读取流数据或结构化数据时可产生异常 Exceptions can occur when reading streaming data or structured data
-
-
Method Details
-
loadData
加载文件中的数据,并转化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
实现Configuration接口,通过搜索命令检索索引中的数据并返回结果列表 Implement the Configuration interface, retrieve the data in the index through the search command and return the result list- Specified by:
getValueListBySearchin interfaceConfiguration- Parameters:
searchCommand- 搜索命令,格式类似XPath语法,以"//"开始每层用"/"分割开 Search command, the format is similar to XPath syntax, starting with "//" and separating each layer with "/"- Returns:
- 搜索结果列表 Search result list
-