1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.generator.config;
17
18 import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
19 import static org.mybatis.generator.internal.util.messages.Messages.getString;
20
21 import java.util.List;
22
23 import org.mybatis.generator.api.dom.xml.Attribute;
24 import org.mybatis.generator.api.dom.xml.XmlElement;
25
26
27
28
29
30
31 public class PluginConfiguration extends TypedPropertyHolder {
32 public PluginConfiguration() {
33 }
34
35 public XmlElement toXmlElement() {
36 XmlElement answer = new XmlElement("plugin");
37 if (getConfigurationType() != null) {
38 answer.addAttribute(new Attribute("type", getConfigurationType()));
39 }
40
41 addPropertyXmlElements(answer);
42
43 return answer;
44 }
45
46 public void validate(List<String> errors, String contextId) {
47 if (!stringHasValue(getConfigurationType())) {
48 errors.add(getString("ValidationError.17",
49 contextId));
50 }
51 }
52 }