KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > transform > DefaultArtifactTransformationManager


1 package org.apache.maven.artifact.transform;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * 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, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.artifact.Artifact;
20 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
21 import org.apache.maven.artifact.installer.ArtifactInstallationException;
22 import org.apache.maven.artifact.repository.ArtifactRepository;
23 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
24 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
25
26 import java.util.Iterator JavaDoc;
27 import java.util.List JavaDoc;
28
29 public class DefaultArtifactTransformationManager
30     implements ArtifactTransformationManager
31 {
32     private List JavaDoc artifactTransformations;
33
34     public void transformForResolve( Artifact artifact, List JavaDoc remoteRepositories, ArtifactRepository localRepository )
35         throws ArtifactResolutionException, ArtifactNotFoundException
36     {
37         for ( Iterator JavaDoc i = artifactTransformations.iterator(); i.hasNext(); )
38         {
39             ArtifactTransformation transform = (ArtifactTransformation) i.next();
40             transform.transformForResolve( artifact, remoteRepositories, localRepository );
41         }
42     }
43
44     public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
45         throws ArtifactInstallationException
46     {
47         for ( Iterator JavaDoc i = artifactTransformations.iterator(); i.hasNext(); )
48         {
49             ArtifactTransformation transform = (ArtifactTransformation) i.next();
50             transform.transformForInstall( artifact, localRepository );
51         }
52     }
53
54     public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
55                                         ArtifactRepository localRepository )
56         throws ArtifactDeploymentException
57     {
58         for ( Iterator JavaDoc i = artifactTransformations.iterator(); i.hasNext(); )
59         {
60             ArtifactTransformation transform = (ArtifactTransformation) i.next();
61             transform.transformForDeployment( artifact, remoteRepository, localRepository );
62         }
63     }
64
65 }
66
Popular Tags