View Javadoc
1   package org.apache.maven.shared.release.transform.jdom;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  
24  import org.apache.maven.model.Dependency;
25  import org.apache.maven.model.Exclusion;
26  import org.apache.maven.shared.release.transform.MavenCoordinate;
27  import org.jdom.Element;
28  
29  /**
30   * JDom implementation of poms DEPENDENCY element
31   *
32   * @author Robert Scholte
33   * @since 3.0
34   */
35  public class JDomDependency extends Dependency implements MavenCoordinate
36  {
37      private final MavenCoordinate coordinate;
38  
39      public JDomDependency( Element dependency )
40      {
41          this.coordinate = new JDomMavenCoordinate( dependency );
42      }
43  
44      @Override
45      public void addExclusion( Exclusion exclusion )
46      {
47          throw new UnsupportedOperationException();
48      }
49  
50      @Override
51      public String getArtifactId()
52      {
53          return coordinate.getArtifactId();
54      }
55  
56      @Override
57      public String getClassifier()
58      {
59          throw new UnsupportedOperationException();
60      }
61  
62      @Override
63      public List<Exclusion> getExclusions()
64      {
65          throw new UnsupportedOperationException();
66      }
67  
68      @Override
69      public String getGroupId()
70      {
71          return coordinate.getGroupId();
72      }
73  
74      @Override
75      public String getScope()
76      {
77          throw new UnsupportedOperationException();
78      }
79  
80      @Override
81      public String getSystemPath()
82      {
83          throw new UnsupportedOperationException();
84      }
85  
86      @Override
87      public String getType()
88      {
89          throw new UnsupportedOperationException();
90      }
91  
92      @Override
93      public String getVersion()
94      {
95          return coordinate.getVersion();
96      }
97  
98      @Override
99      public boolean isOptional()
100     {
101         throw new UnsupportedOperationException();
102     }
103 
104     @Override
105     public void removeExclusion( Exclusion exclusion )
106     {
107         throw new UnsupportedOperationException();
108     }
109 
110     @Override
111     public void setArtifactId( String artifactId )
112     {
113         throw new UnsupportedOperationException();
114     }
115 
116     @Override
117     public void setClassifier( String classifier )
118     {
119         throw new UnsupportedOperationException();
120     }
121 
122     @Override
123     public void setExclusions( List<Exclusion> exclusions )
124     {
125         throw new UnsupportedOperationException();
126     }
127 
128     @Override
129     public void setGroupId( String groupId )
130     {
131         throw new UnsupportedOperationException();
132     }
133 
134     @Override
135     public void setOptional( boolean optional )
136     {
137         throw new UnsupportedOperationException();
138     }
139 
140     @Override
141     public void setScope( String scope )
142     {
143         throw new UnsupportedOperationException();
144     }
145 
146     @Override
147     public void setSystemPath( String systemPath )
148     {
149         throw new UnsupportedOperationException();
150     }
151 
152     @Override
153     public void setType( String type )
154     {
155         throw new UnsupportedOperationException();
156     }
157 
158     @Override
159     public void setVersion( String version )
160     {
161         coordinate.setVersion( version );
162     }
163 
164     @Override
165     public String getName()
166     {
167         return "dependency";
168     }
169 }