001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.eclipse.aether.internal.impl.synccontext.named; 020 021/** 022 * As end-user "mappers" are actually configurations/compositions and are constructed from several NameMapper 023 * implementations, this helper class constructing them. This class also holds "names" used by service locator and 024 * Guice/Sisu as well. 025 * 026 * @since 1.9.4 027 */ 028public final class NameMappers { 029 public static final String STATIC_NAME = "static"; 030 031 public static final String GAV_NAME = "gav"; 032 033 public static final String FILE_GAV_NAME = "file-gav"; 034 035 public static final String FILE_HGAV_NAME = "file-hgav"; 036 037 public static final String DISCRIMINATING_NAME = "discriminating"; 038 039 public static NameMapper staticNameMapper() { 040 return new StaticNameMapper(); 041 } 042 043 public static NameMapper gavNameMapper() { 044 return GAVNameMapper.gav(); 045 } 046 047 public static NameMapper fileGavNameMapper() { 048 return new BasedirNameMapper(GAVNameMapper.fileGav()); 049 } 050 051 public static NameMapper fileHashingGavNameMapper() { 052 return new BasedirNameMapper(new HashingNameMapper(GAVNameMapper.gav())); 053 } 054 055 public static NameMapper discriminatingNameMapper() { 056 return new DiscriminatingNameMapper(GAVNameMapper.gav()); 057 } 058}