Search in sources :

Example 1 with PluginConfiguration

use of org.mybatis.generator.config.PluginConfiguration in project generator by mybatis.

the class IbatorConfigurationParser method parseIbatorPlugin.

private void parseIbatorPlugin(Context context, Node node) {
    PluginConfiguration pluginConfiguration = new PluginConfiguration();
    context.addPluginConfiguration(pluginConfiguration);
    Properties attributes = parseAttributes(node);
    //$NON-NLS-1$
    String type = attributes.getProperty("type");
    pluginConfiguration.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(pluginConfiguration, childNode);
        }
    }
}
Also used : NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node) PluginConfiguration(org.mybatis.generator.config.PluginConfiguration) Properties(java.util.Properties)

Example 2 with PluginConfiguration

use of org.mybatis.generator.config.PluginConfiguration in project generator by mybatis.

the class MyBatisGeneratorConfigurationParser method parsePlugin.

private void parsePlugin(Context context, Node node) {
    PluginConfiguration pluginConfiguration = new PluginConfiguration();
    context.addPluginConfiguration(pluginConfiguration);
    Properties attributes = parseAttributes(node);
    //$NON-NLS-1$
    String type = attributes.getProperty("type");
    pluginConfiguration.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(pluginConfiguration, childNode);
        }
    }
}
Also used : NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node) PluginConfiguration(org.mybatis.generator.config.PluginConfiguration) Messages.getString(org.mybatis.generator.internal.util.messages.Messages.getString) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)2 PluginConfiguration (org.mybatis.generator.config.PluginConfiguration)2 Node (org.w3c.dom.Node)2 NodeList (org.w3c.dom.NodeList)2 Messages.getString (org.mybatis.generator.internal.util.messages.Messages.getString)1