use of org.apache.ibatis.parsing.GenericTokenParser in project mybatis-3 by mybatis.
the class SqlSourceBuilder method parse.
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());
}
use of org.apache.ibatis.parsing.GenericTokenParser in project mybatis-3 by mybatis.
the class TextSqlNode method apply.
@Override
public boolean apply(DynamicContext context) {
GenericTokenParser parser = createParser(new BindingTokenParser(context, injectionFilter));
context.appendSql(parser.parse(text));
return true;
}
use of org.apache.ibatis.parsing.GenericTokenParser in project mybatis-3 by mybatis.
the class VelocitySqlSourceBuilder method parse.
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());
}
use of org.apache.ibatis.parsing.GenericTokenParser in project mybatis-3 by mybatis.
the class TextSqlNode method isDynamic.
public boolean isDynamic() {
DynamicCheckerTokenParser checker = new DynamicCheckerTokenParser();
GenericTokenParser parser = createParser(checker);
parser.parse(text);
return checker.isDynamic();
}
Aggregations