1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.shared.release.transform.jdom2;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.Map;
25
26 import org.apache.maven.model.ReportPlugin;
27 import org.apache.maven.model.Reporting;
28 import org.jdom2.Element;
29
30
31
32
33
34
35
36 public class JDomReporting extends Reporting {
37
38 private final Element reporting;
39
40
41
42
43
44
45 public JDomReporting(Element reporting) {
46 this.reporting = reporting;
47 }
48
49 @Override
50 public void addPlugin(ReportPlugin reportPlugin) {
51 throw new UnsupportedOperationException();
52 }
53
54 @Override
55 public String getOutputDirectory() {
56 throw new UnsupportedOperationException();
57 }
58
59 @Override
60 public List<ReportPlugin> getPlugins() {
61 Element pluginsElm = reporting.getChild("plugins", reporting.getNamespace());
62 if (pluginsElm == null) {
63 return Collections.emptyList();
64 } else {
65 List<Element> pluginElms = pluginsElm.getChildren("plugin", reporting.getNamespace());
66
67 List<ReportPlugin> plugins = new ArrayList<>(pluginElms.size());
68
69 for (Element pluginElm : pluginElms) {
70 plugins.add(new JDomReportPlugin(pluginElm));
71 }
72
73 return plugins;
74 }
75 }
76
77 @Override
78 public void removePlugin(ReportPlugin reportPlugin) {
79 throw new UnsupportedOperationException();
80 }
81
82 @Override
83 public void setOutputDirectory(String outputDirectory) {
84 throw new UnsupportedOperationException();
85 }
86
87 @Override
88 public void setPlugins(List<ReportPlugin> plugins) {
89 throw new UnsupportedOperationException();
90 }
91
92 @Override
93 public void flushReportPluginMap() {
94 throw new UnsupportedOperationException();
95 }
96
97 @Override
98 public Map<String, ReportPlugin> getReportPluginsAsMap() {
99 throw new UnsupportedOperationException();
100 }
101
102 @Override
103 public boolean isExcludeDefaults() {
104 throw new UnsupportedOperationException();
105 }
106
107 @Override
108 public void setExcludeDefaults(boolean excludeDefaults) {
109 throw new UnsupportedOperationException();
110 }
111 }