本文整理汇总了Java中org.apache.ibatis.parsing.GenericTokenParser类的典型用法代码示例。如果您正苦于以下问题:Java GenericTokenParser类的具体用法?Java GenericTokenParser怎么用?Java GenericTokenParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericTokenParser类属于org.apache.ibatis.parsing包,在下文中一共展示了GenericTokenParser类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: appendSql
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
@Override
public void appendSql(String sql) {
GenericTokenParser parser = new GenericTokenParser("#{", "}", new TokenHandler() {
@Override
public String handleToken(String content) {
String newContent = content.replaceFirst("^\\s*" + item + "(?![^.,:\\s])", itemizeItem(item, index));
if (itemIndex != null && newContent.equals(content)) {
newContent = content.replaceFirst("^\\s*" + itemIndex + "(?![^.,:\\s])", itemizeItem(itemIndex, index));
}
return new StringBuilder("#{").append(newContent).append("}").toString();
}
});
delegate.appendSql(parser.parse(sql));
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:16,代码来源:ForEachSqlNode.java
示例2: parse
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
public SqlSource parse(String originalSql, Class<?> parameterType, Map<String, Object> additionalParameters) {
ParameterMappingTokenHandler handler = new ParameterMappingTokenHandler(configuration, parameterType, additionalParameters);
//替换#{}中间的部分,如何替换,逻辑在ParameterMappingTokenHandler
GenericTokenParser parser = new GenericTokenParser("#{", "}", handler);
String sql = parser.parse(originalSql);
//返回静态SQL源码
return new StaticSqlSource(configuration, sql, handler.getParameterMappings());
}
开发者ID:shurun19851206,项目名称:mybaties,代码行数:9,代码来源:SqlSourceBuilder.java
示例3: isDynamic
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
public boolean isDynamic() {
DynamicCheckerTokenParser checker = new DynamicCheckerTokenParser();
GenericTokenParser parser = createParser(checker);
parser.parse(text);
return checker.isDynamic();
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:7,代码来源:TextSqlNode.java
示例4: apply
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
@Override
public boolean apply(DynamicContext context) {
GenericTokenParser parser = createParser(new BindingTokenParser(context, injectionFilter));
context.appendSql(parser.parse(text));
return true;
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:7,代码来源:TextSqlNode.java
示例5: createParser
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
private GenericTokenParser createParser(TokenHandler handler) {
return new GenericTokenParser("${", "}", handler);
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:4,代码来源:TextSqlNode.java
示例6: parse
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
public SqlSource parse(String originalSql, Class<?> parameterType, Map<String, Object> additionalParameters) {
ParameterMappingTokenHandler handler = new ParameterMappingTokenHandler(configuration, parameterType, additionalParameters);
GenericTokenParser parser = new GenericTokenParser("#{", "}", handler);
String sql = parser.parse(originalSql);
return new StaticSqlSource(configuration, sql, handler.getParameterMappings());
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:7,代码来源:SqlSourceBuilder.java
示例7: parse
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
public SqlSource parse(String originalSql, Class<?> parameterType) {
ParameterMappingTokenHandler handler = new ParameterMappingTokenHandler(configuration, parameterType);
GenericTokenParser parser = new GenericTokenParser("@{", "}", handler);
String sql = parser.parse(originalSql);
return new StaticSqlSource(configuration, sql, handler.getParameterMappings());
}
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:7,代码来源:VelocitySqlSourceBuilder.java
示例8: ParameterMappingSourceParser
import org.apache.ibatis.parsing.GenericTokenParser; //导入依赖的package包/类
public ParameterMappingSourceParser(Configuration configuration, String script, Class<?> parameterType) {
ParameterMappingTokenHandler handler = new ParameterMappingTokenHandler(configuration, parameterType);
GenericTokenParser parser = new GenericTokenParser("@{", "}", handler);
this.sql = parser.parse(script);
this.parameterMappingSources = handler.getParameterMappingSources();
}
开发者ID:mybatis,项目名称:velocity-scripting,代码行数:7,代码来源:ParameterMappingSourceParser.java
注:本文中的org.apache.ibatis.parsing.GenericTokenParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论