Package org.apache.ibatis.builder.xml
Class XMLIncludeTransformer
- java.lang.Object
-
- org.apache.ibatis.builder.xml.XMLIncludeTransformer
-
public class XMLIncludeTransformer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private MapperBuilderAssistant
builderAssistant
private Configuration
configuration
-
Constructor Summary
Constructors Constructor Description XMLIncludeTransformer(Configuration configuration, MapperBuilderAssistant builderAssistant)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyIncludes(org.w3c.dom.Node source)
private void
applyIncludes(org.w3c.dom.Node source, java.util.Properties variablesContext, boolean included)
Recursively apply includes through all SQL fragments.private org.w3c.dom.Node
findSqlFragment(java.lang.String refid, java.util.Properties variables)
private java.lang.String
getStringAttribute(org.w3c.dom.Node node, java.lang.String name)
private java.util.Properties
getVariablesContext(org.w3c.dom.Node node, java.util.Properties inheritedVariablesContext)
Read placeholders and their values from include node definition.
-
-
-
Field Detail
-
configuration
private final Configuration configuration
-
builderAssistant
private final MapperBuilderAssistant builderAssistant
-
-
Constructor Detail
-
XMLIncludeTransformer
public XMLIncludeTransformer(Configuration configuration, MapperBuilderAssistant builderAssistant)
-
-
Method Detail
-
applyIncludes
public void applyIncludes(org.w3c.dom.Node source)
-
applyIncludes
private void applyIncludes(org.w3c.dom.Node source, java.util.Properties variablesContext, boolean included)
Recursively apply includes through all SQL fragments.- Parameters:
source
- Include node in DOM treevariablesContext
- Current context for static variables with values
-
findSqlFragment
private org.w3c.dom.Node findSqlFragment(java.lang.String refid, java.util.Properties variables)
-
getStringAttribute
private java.lang.String getStringAttribute(org.w3c.dom.Node node, java.lang.String name)
-
getVariablesContext
private java.util.Properties getVariablesContext(org.w3c.dom.Node node, java.util.Properties inheritedVariablesContext)
Read placeholders and their values from include node definition.- Parameters:
node
- Include node instanceinheritedVariablesContext
- Current context used for replace variables in new variables values- Returns:
- variables context from include instance (no inherited values)
-
-