use of org.mybatis.generator.config.CommentGeneratorConfiguration in project generator by mybatis.
the class MyBatisGeneratorConfigurationParser method parseCommentGenerator.
protected void parseCommentGenerator(Context context, Node node) {
CommentGeneratorConfiguration commentGeneratorConfiguration = new CommentGeneratorConfiguration();
context.setCommentGeneratorConfiguration(commentGeneratorConfiguration);
Properties attributes = parseAttributes(node);
//$NON-NLS-1$
String type = attributes.getProperty("type");
if (stringHasValue(type)) {
commentGeneratorConfiguration.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(commentGeneratorConfiguration, childNode);
}
}
}
use of org.mybatis.generator.config.CommentGeneratorConfiguration in project generator by mybatis.
the class ObjectFactory method createCommentGenerator.
/**
* Creates a new Object object.
*
* @param context
* the context
* @return the comment generator
*/
public static CommentGenerator createCommentGenerator(Context context) {
CommentGeneratorConfiguration config = context.getCommentGeneratorConfiguration();
CommentGenerator answer;
String type;
if (config == null || config.getConfigurationType() == null) {
type = DefaultCommentGenerator.class.getName();
} else {
type = config.getConfigurationType();
}
answer = (CommentGenerator) createInternalObject(type);
if (config != null) {
answer.addConfigurationProperties(config.getProperties());
}
return answer;
}
Aggregations