1 package org.apache.maven.repository.indexing;
4 * Copyright 2001-2005 The Apache Software Foundation.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 import java.util.HashMap;
22 import org.apache.maven.artifact.Artifact;
23 import org.apache.maven.artifact.repository.ArtifactRepository;
27 * @author Edwin Punzalan
29 public class DefaultRepositoryIndexerFactory
30 implements RepositoryIndexerFactory
32 Map indexerMap = new HashMap();
34 public RepositoryIndexer getRepositoryIndexer( ArtifactRepository repository, Class indexType )
36 if ( !indexerMap.containsKey( indexType ) )
38 RepositoryIndexer indexer;
40 if ( Artifact.class == indexType )
42 indexer = new ArtifactRepositoryIndexer( );
49 indexerMap.put( indexType, indexer );
52 return (RepositoryIndexer) indexerMap.get( indexType );