View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.shared.release.transform.jdom2;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  import org.apache.maven.model.ReportPlugin;
25  import org.apache.maven.model.ReportSet;
26  import org.apache.maven.shared.release.transform.MavenCoordinate;
27  import org.jdom2.Element;
28  
29  /**
30   * JDOM2 implementation of poms reports PLUGIN element
31   *
32   * @author Robert Scholte
33   * @since 3.0
34   */
35  public class JDomReportPlugin extends ReportPlugin implements MavenCoordinate {
36      private final MavenCoordinate coordinate;
37  
38      /**
39       * <p>Constructor for JDomReportPlugin.</p>
40       *
41       * @param reportPlugin a {@link org.jdom2.Element} object
42       */
43      public JDomReportPlugin(Element reportPlugin) {
44          this.coordinate = new JDomMavenCoordinate(reportPlugin);
45      }
46  
47      @Override
48      public void addReportSet(ReportSet reportSet) {
49          throw new UnsupportedOperationException();
50      }
51  
52      @Override
53      public String getArtifactId() {
54          return coordinate.getArtifactId();
55      }
56  
57      @Override
58      public Object getConfiguration() {
59          throw new UnsupportedOperationException();
60      }
61  
62      @Override
63      public String getGroupId() {
64          return coordinate.getGroupId();
65      }
66  
67      @Override
68      public String getInherited() {
69          throw new UnsupportedOperationException();
70      }
71  
72      @Override
73      public List<ReportSet> getReportSets() {
74          throw new UnsupportedOperationException();
75      }
76  
77      @Override
78      public String getVersion() {
79          return coordinate.getVersion();
80      }
81  
82      @Override
83      public void removeReportSet(ReportSet reportSet) {
84          throw new UnsupportedOperationException();
85      }
86  
87      @Override
88      public void setArtifactId(String artifactId) {
89          throw new UnsupportedOperationException();
90      }
91  
92      @Override
93      public void setConfiguration(Object configuration) {
94          throw new UnsupportedOperationException();
95      }
96  
97      @Override
98      public void setGroupId(String groupId) {
99          throw new UnsupportedOperationException();
100     }
101 
102     @Override
103     public void setInherited(String inherited) {
104         throw new UnsupportedOperationException();
105     }
106 
107     @Override
108     public void setReportSets(List<ReportSet> reportSets) {
109         throw new UnsupportedOperationException();
110     }
111 
112     @Override
113     public void setVersion(String version) {
114         coordinate.setVersion(version);
115     }
116 
117     @Override
118     public void flushReportSetMap() {
119         throw new UnsupportedOperationException();
120     }
121 
122     @Override
123     public Map<String, ReportSet> getReportSetsAsMap() {
124         throw new UnsupportedOperationException();
125     }
126 
127     @Override
128     public String getKey() {
129         throw new UnsupportedOperationException();
130     }
131 
132     @Override
133     public void unsetInheritanceApplied() {
134         throw new UnsupportedOperationException();
135     }
136 
137     @Override
138     public boolean isInheritanceApplied() {
139         throw new UnsupportedOperationException();
140     }
141 
142     @Override
143     public String getName() {
144         return "plugin";
145     }
146 }