1 package org.eclipse.aether.util.filter; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import java.util.Collection; 23 24 import org.eclipse.aether.version.VersionScheme; 25 26 /** 27 * A simple filter to include artifacts from a list of patterns. The artifact pattern syntax is of the form: 28 * 29 * <pre> 30 * [groupId]:[artifactId]:[extension]:[version] 31 * </pre> 32 * <p> 33 * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern 34 * segment is treated as an implicit wildcard. Version can be a range in case a {@link VersionScheme} is specified. 35 * </p> 36 * <p> 37 * For example, <code>org.eclipse.*</code> would match all artifacts whose group id started with 38 * <code>org.eclipse.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts. 39 * </p> 40 */ 41 public final class PatternInclusionsDependencyFilter 42 extends AbstractPatternDependencyFilter 43 { 44 45 /** 46 * Creates a new filter using the specified patterns. 47 * 48 * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. 49 */ 50 public PatternInclusionsDependencyFilter( final String... patterns ) 51 { 52 super( patterns ); 53 } 54 55 /** 56 * Creates a new filter using the specified patterns. 57 * 58 * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a 59 * range no artifact will be included. 60 * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. 61 */ 62 public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns ) 63 { 64 super( versionScheme, patterns ); 65 } 66 67 /** 68 * Creates a new filter using the specified patterns. 69 * 70 * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. 71 */ 72 public PatternInclusionsDependencyFilter( final Collection<String> patterns ) 73 { 74 super( patterns ); 75 } 76 77 /** 78 * Creates a new filter using the specified patterns and {@link VersionScheme} . 79 * 80 * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a 81 * range no artifact will be included. 82 * @param patterns The include patterns, may be {@code null} or empty to include no artifacts. 83 */ 84 public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns ) 85 { 86 super( versionScheme, patterns ); 87 } 88 89 }