public class FileSqlManager extends Object implements SqlManager
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowDuplicate |
protected boolean |
inited |
protected String |
pairBegin |
protected String |
pairEnd |
protected String[] |
paths |
protected String |
regex |
protected Map<String,String> |
sqls |
Constructor and Description |
---|
FileSqlManager() |
FileSqlManager(String... paths) |
Modifier and Type | Method and Description |
---|---|
protected void |
_check_inited() |
void |
add(Reader r) |
void |
addSql(String key,
String value)
增加一条 Sql
|
void |
clear() |
int |
count() |
Sql |
create(String key)
创建一个 Sql 对象
|
List<Sql> |
createCombo(String... keys)
根据一组 Sql 的键值,创建一个 Sql 列表
|
String |
get(String key)
获取一段 Sql 的原始文本
|
String |
getPairBegin() |
String |
getPairEnd() |
String[] |
getPaths() |
String |
getRegex() |
boolean |
isAllowDuplicate() |
String[] |
keys() |
void |
refresh()
刷新缓存
|
void |
remove(String key)
移除一条 Sql
|
void |
setAllowDuplicate(boolean allowDuplicate) |
void |
setPairBegin(String pairBegin) |
void |
setPairEnd(String pairEnd) |
void |
setPaths(String[] paths) |
FileSqlManager |
setRegex(String regex) |
protected String[] paths
protected boolean allowDuplicate
protected String pairBegin
protected String pairEnd
protected String regex
protected boolean inited
public FileSqlManager()
public FileSqlManager(String... paths)
public void refresh()
SqlManager
refresh
in interface SqlManager
public void add(Reader r) throws IOException
IOException
public String get(String key) throws SqlNotFoundException
SqlManager
get
in interface SqlManager
key
- Sql 的键值SqlNotFoundException
public Sql create(String key) throws SqlNotFoundException
SqlManager
create
in interface SqlManager
key
- Sql 的键值SqlNotFoundException
public List<Sql> createCombo(String... keys)
SqlManager
createCombo
in interface SqlManager
keys
- 键值数组public int count()
count
in interface SqlManager
public String[] keys()
keys
in interface SqlManager
public void addSql(String key, String value)
SqlManager
addSql
in interface SqlManager
key
- 键值value
- Sql 原始字符串public void remove(String key)
SqlManager
remove
in interface SqlManager
key
- 键值public void setAllowDuplicate(boolean allowDuplicate)
public boolean isAllowDuplicate()
public void setPaths(String[] paths)
public String getRegex()
public FileSqlManager setRegex(String regex)
public void setPairBegin(String pairBegin)
public void setPairEnd(String pairEnd)
public String getPairBegin()
public String getPairEnd()
public String[] getPaths()
protected void _check_inited()
public void clear()
clear
in interface SqlManager
Copyright © 2017. All rights reserved.