public abstract class AbstractFormat extends Object implements Configuration
| Modifier and Type | Field and Description |
|---|---|
protected String |
content |
protected LinkedHashMap<String,Object> |
data |
protected LinkedHashMap<String,String> |
index |
| Constructor and Description |
|---|
AbstractFormat(InputStream inputStream)
构造函数 Constructor
|
AbstractFormat(String content)
构造函数 Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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
|
protected abstract LinkedHashMap<String,Object> |
loadData()
加载文件中的数据,并转化LinkedHashMap结构 Load the data in the file and convert LinkedHashMap structure
|
protected final String content
protected final LinkedHashMap<String,String> index
protected LinkedHashMap<String,Object> data
public AbstractFormat(String content) throws Exception
content - 文件内容 document contentException - 结构化数据时可产生异常 Exceptions can occur when structuring datapublic AbstractFormat(InputStream inputStream) throws Exception
inputStream - 文件的输入流对象 File input stream objectException - 读取流数据或结构化数据时可产生异常 Exceptions can occur when reading streaming data or structured dataprotected abstract LinkedHashMap<String,Object> loadData() throws Exception
Exception - 读取数据或结构化数据时可产生异常 Exceptions can occur when reading data or structured datapublic List<String> getValueListBySearch(String searchCommand)
getValueListBySearch in interface ConfigurationsearchCommand - 搜索命令,格式类似XPath语法,以"//"开始每层用"/"分割开 Search command, the format is similar to XPath syntax, starting with "//" and separating each layer with "/"Copyright © 2016–2021. All rights reserved.