package com.ibatis.sqlmap.engine.builder.xml;
import com.ibatis.common.resources.*;
import com.ibatis.sqlmap.engine.config.*;
import javax.sql.DataSource;
import java.util.*;
//杩欐槸涓�釜杞寲绫伙紝鍏呭綋浜嗗崗璋冭�瑙掕壊
public class XmlParserState {
private SqlMapConfiguration config = new SqlMapConfiguration();
private Properties globalProps = new Properties();
private Properties txProps = new Properties();
private Properties dsProps = new Properties();
private Properties cacheProps = new Properties();
private boolean useStatementNamespaces = false;
private Map sqlIncludes = new HashMap();
private ParameterMapConfig paramConfig;
private ResultMapConfig resultConfig;
private CacheModelConfig cacheConfig;
private String namespace;
private DataSource dataSource;
public SqlMapConfiguration getConfig() {
return config;
}
public void setGlobalProps(Properties props) {
globalProps = props;
}
public Properties getGlobalProps() {
return globalProps;
}
public Properties getTxProps() {
return txProps;
}
public Properties getDsProps() {
return dsProps;
}
public Properties getCacheProps() {
return cacheProps;
}
public void setUseStatementNamespaces(boolean useStatementNamespaces) {
this.useStatementNamespaces = useStatementNamespaces;
}
public boolean isUseStatementNamespaces() {
return useStatementNamespaces;
}
public Map getSqlIncludes() {
return sqlIncludes;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public String applyNamespace(String id) {
String newId = id;
if (namespace != null && namespace.length() > 0 && id != null && id.indexOf('.') < 0) {
newId = namespace + "." + id;
}
return newId;
}
public CacheModelConfig getCacheConfig() {
return cacheConfig;
}
public void setCacheConfig(CacheModelConfig cacheConfig) {
this.cacheConfig = cacheConfig;
}
public ParameterMapConfig getParamConfig() {
return paramConfig;
}
public void setParamConfig(ParameterMapConfig paramConfig) {
this.paramConfig = paramConfig;
}
public ResultMapConfig getResultConfig() {
return resultConfig;
}
public void setResultConfig(ResultMapConfig resultConfig) {
this.resultConfig = resultConfig;
}
public String getFirstToken(String s) {
return new StringTokenizer(s, ", ", false).nextToken();
}
public String[] getAllButFirstToken(String s) {
List strings = new ArrayList();
StringTokenizer parser = new StringTokenizer(s, ", ", false);
parser.nextToken();
while (parser.hasMoreTokens()) {
strings.add(parser.nextToken());
}
return (String[]) strings.toArray(new String[strings.size()]);
}
public void setGlobalProperties(String resource, String url) {
config.getErrorContext().setActivity("loading global properties");
try {
Properties props;
if (resource != null) {
config.getErrorContext().setResource(resource);
props = Resources.getResourceAsProperties(resource);
} else if (url != null) {
config.getErrorContext().setResource(url);
props = Resources.getUrlAsProperties(url);
} else {
throw new RuntimeException("The " + "properties" + " element requires either a resource or a url attribute.");
}
// Merge properties with those passed in programmatically
if (props != null) {
props.putAll(globalProps);
globalProps = props;
}
} catch (Exception e) {
throw new RuntimeException("Error loading properties. Cause: " + e, e);
}
}
public DataSource getDataSource() {
return dataSource;
}
public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
}
}
分享到:
相关推荐
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
2024嵌入式大厂面经50套大厂高频面试题资料
eclipaint-eclipse插件
该TemplateAppProject是一个基于XUI、XUtil、XAOP等框架构建的Android模版空壳工程,包含172个文件,涵盖68个Java源文件、64个XML配置文件、17个PNG图片文件、6个Gradle脚本文件、2个YAML配置文件、2个Git忽略文件、2个文本文件和1个Markdown文件。该工程集成了XPage、XUpdate和XHttp2等功能,旨在快速搭建Android应用开发环境。
IEA乌克兰的能源安全和即将到来的冬天-乌克兰及其合作伙伴的能源行动计划(英).pdf
UC-GUI文档uCGUI中文手册UC-GUI文档uCGUI中文手册
微信小程序反编译_ xapkg解包器
微信小程序婚礼邀请函_婚礼邀请函
该项目是一款基于Html和TypeScript构建的2B2C礼品购买平台源码,包含958个文件,涵盖196个TypeScript文件、145个Java文件、119个JPG图片、118个CSS文件、85个JavaScript文件、54个HTML文件、47个类文件、44个XML文件、26个PNG图片、23个Vue组件。该平台采用现代化前端技术,旨在提供一个流畅的礼品选购体验。
Fedora-Workstation-Live-x86_64-40-1.14.iso.008
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
Fedora-Workstation-Live-x86_64-40-1.14.iso.002
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
【作品名称】:基于Matlab的单水箱液位的模糊控制系统设计【含课程设计报告+程序】 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】: 控制⽬标 控制⽬标:倒锥形容器的液位⾼度h=h0 检测装置:通过测量容器底部压⼒来间接测量液位 执⾏机构:控制进⽔电磁阀V1的开启度开启度 u ∈ [0, 90 ∘ ] 受控对象:模糊控制器最终影响倒锥形容器内的⽔量,所以受控对象是倒锥形容器 为简单起⻅,假设电磁阀V1的开启度与进⽔量间呈线性关系。所以控制进⽔量Qi实际上就是控制 电磁阀V1的开启度u。 因此对于整个系统⽽⾔,模糊控制器最终控制的是电磁阀V1的开启度u,从⽽控制倒锥形容器内 的⽔量。 注意:模糊控制器受控对象是倒锥形容器,其液位⾼度h和进⽔量Qi间的关系不是线性关系 电磁阀V2的开度固定,但出⽔量Qo与倒锥形容器的液位⾼ 【资源声明】:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。
包含RMI服务所需的内容和测试使用的攻击FastJson1反序列化漏洞的Java文件
Wanandroid微信小程序w_x-Wanandroid
Fedora-Workstation-Live-x86_64-40-1.14.iso.005
全国大学生电子设计大赛项目合集全国电赛优秀作品STM32项目基于stm32和mpu9250的usbhid键盘,鼠标,游戏控制器
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
AutoLine是一个基于Python的通用自动化测试开源平台,包含了657个文件,涵盖228个PNG图片、209个CSS样式、95个JavaScript脚本、39个Python源代码、21个HTML文件、19个XML文件、14个GIF图片、6个DS_Store文件、5个文本文件、4个Markdown文件。该平台的设计源码由多种编程语言编写,旨在提供灵活高效的自动化测试解决方案。