1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. 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, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.maven.shared.artifact.filter.resolve; 20 21 /** 22 * Provide a mechanism to transform a Filter to a tool specific equivalent using the visitor pattern. 23 * For example: Aether has its own set of filters. 24 * 25 * @author Robert Scholte 26 * @param <T> the tool specific filter 27 * @since 3.0 28 */ 29 public interface FilterTransformer<T> { 30 /** 31 * Transform the scopeFilter to T specific implementation 32 * 33 * @param scopeFilter the filter 34 * @return the transformed filter, never {@code null} 35 */ 36 T transform(ScopeFilter scopeFilter); 37 38 /** 39 * Transform the andFilter to T specific implementation 40 * 41 * @param andFilter the filter 42 * @return the transformed filter, never {@code null} 43 */ 44 T transform(AndFilter andFilter); 45 46 /** 47 * Transform the exclusionsFilter to T specific implementation 48 * 49 * @param exclusionsFilter the filter 50 * @return the transformed filter, never {@code null} 51 */ 52 T transform(ExclusionsFilter exclusionsFilter); 53 54 /** 55 * Transform the orFilter to T specific implementation 56 * 57 * @param orFilter the filter 58 * @return the transformed filter, never {@code null} 59 */ 60 T transform(OrFilter orFilter); 61 62 /** 63 * Transform the patternExclusionsFilter to T specific implementation 64 * 65 * @param patternExclusionsFilter the filter 66 * @return the transformed filter, never {@code null} 67 */ 68 T transform(PatternExclusionsFilter patternExclusionsFilter); 69 70 /** 71 * Transform the paternInclusionsFilter to T specific implementation 72 * 73 * @param patternInclusionsFilter the filter 74 * @return the transformed filter, never {@code null} 75 */ 76 T transform(PatternInclusionsFilter patternInclusionsFilter); 77 78 /** 79 * Transform a custom filter to T specific implementation 80 * 81 * @param abstractFilter the filter 82 * @return the transformed filter, never {@code null} 83 */ 84 T transform(AbstractFilter abstractFilter); 85 }