use of org.mybatis.generator.config.JavaTypeResolverConfiguration in project generator by mybatis.
the class MyBatisGeneratorConfigurationParser method parseJavaTypeResolver.
protected void parseJavaTypeResolver(Context context, Node node) {
JavaTypeResolverConfiguration javaTypeResolverConfiguration = new JavaTypeResolverConfiguration();
context.setJavaTypeResolverConfiguration(javaTypeResolverConfiguration);
Properties attributes = parseAttributes(node);
//$NON-NLS-1$
String type = attributes.getProperty("type");
if (stringHasValue(type)) {
javaTypeResolverConfiguration.setConfigurationType(type);
}
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
if ("property".equals(childNode.getNodeName())) {
//$NON-NLS-1$
parseProperty(javaTypeResolverConfiguration, childNode);
}
}
}
use of org.mybatis.generator.config.JavaTypeResolverConfiguration in project generator by mybatis.
the class ObjectFactory method createJavaTypeResolver.
/**
* Creates a new Object object.
*
* @param context
* the context
* @param warnings
* the warnings
* @return the java type resolver
*/
public static JavaTypeResolver createJavaTypeResolver(Context context, List<String> warnings) {
JavaTypeResolverConfiguration config = context.getJavaTypeResolverConfiguration();
String type;
if (config != null && config.getConfigurationType() != null) {
type = config.getConfigurationType();
if ("DEFAULT".equalsIgnoreCase(type)) {
//$NON-NLS-1$
type = JavaTypeResolverDefaultImpl.class.getName();
}
} else {
type = JavaTypeResolverDefaultImpl.class.getName();
}
JavaTypeResolver answer = (JavaTypeResolver) createInternalObject(type);
answer.setWarnings(warnings);
if (config != null) {
answer.addConfigurationProperties(config.getProperties());
}
answer.setContext(context);
return answer;
}
Aggregations