001package org.eclipse.aether.util.filter;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 * 
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 * 
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import java.util.Collection;
023
024import org.eclipse.aether.version.VersionScheme;
025
026/**
027 * A simple filter to include artifacts from a list of patterns. The artifact pattern syntax is of the form:
028 * 
029 * <pre>
030 * [groupId]:[artifactId]:[extension]:[version]
031 * </pre>
032 * <p>
033 * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
034 * segment is treated as an implicit wildcard. Version can be a range in case a {@link VersionScheme} is specified.
035 * </p>
036 * <p>
037 * For example, <code>org.eclipse.*</code> would match all artifacts whose group id started with
038 * <code>org.eclipse.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts.
039 * </p>
040 */
041public final class PatternInclusionsDependencyFilter
042    extends AbstractPatternDependencyFilter
043{
044
045    /**
046     * Creates a new filter using the specified patterns.
047     * 
048     * @param patterns The include patterns, may be {@code null} or empty to include no artifacts.
049     */
050    public PatternInclusionsDependencyFilter( final String... patterns )
051    {
052        super( patterns );
053    }
054
055    /**
056     * Creates a new filter using the specified patterns.
057     * 
058     * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a
059     *            range no artifact will be included.
060     * @param patterns The include patterns, may be {@code null} or empty to include no artifacts.
061     */
062    public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns )
063    {
064        super( versionScheme, patterns );
065    }
066
067    /**
068     * Creates a new filter using the specified patterns.
069     * 
070     * @param patterns The include patterns, may be {@code null} or empty to include no artifacts.
071     */
072    public PatternInclusionsDependencyFilter( final Collection<String> patterns )
073    {
074        super( patterns );
075    }
076
077    /**
078     * Creates a new filter using the specified patterns and {@link VersionScheme} .
079     * 
080     * @param versionScheme To be used for parsing versions/version ranges. If {@code null} and pattern specifies a
081     *            range no artifact will be included.
082     * @param patterns The include patterns, may be {@code null} or empty to include no artifacts.
083     */
084    public PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns )
085    {
086        super( versionScheme, patterns );
087    }
088
089}