KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > handler > manager > DefaultArtifactHandlerManager


1 package org.apache.maven.artifact.handler.manager;
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.handler.ArtifactHandler;
20 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
21
22 import java.util.Map JavaDoc;
23 import java.util.Set JavaDoc;
24
25 /**
26  * @author <a HREF="mailto:jason@maven.org">Jason van Zyl </a>
27  * @version $Id: DefaultArtifactHandlerManager.java,v 1.1.1.1 2004/08/09
28  * 18:37:32 jvanzyl Exp $
29  */

30 public class DefaultArtifactHandlerManager
31     implements ArtifactHandlerManager
32 {
33     private Map JavaDoc artifactHandlers;
34
35     public ArtifactHandler getArtifactHandler( String JavaDoc type )
36     {
37         ArtifactHandler handler = (ArtifactHandler) artifactHandlers.get( type );
38
39         if ( handler == null )
40         {
41             handler = new DefaultArtifactHandler( type );
42         }
43
44         return handler;
45     }
46
47     public void addHandlers( Map JavaDoc handlers )
48     {
49         artifactHandlers.putAll( handlers );
50     }
51
52     public Set JavaDoc getHandlerTypes()
53     {
54         return artifactHandlers.keySet();
55     }
56 }
57
Popular Tags