Klasse PatternSet

java.lang.Object
org.gradle.api.tasks.util.PatternSet
Alle implementierten Schnittstellen:
AntBuilderAware, PatternFilterable

public class PatternSet extends Object implements AntBuilderAware, PatternFilterable
Standalone implementation of PatternFilterable.
  • Konstruktordetails

    • PatternSet

      public PatternSet()
    • PatternSet

      protected PatternSet(PatternSet patternSet)
    • PatternSet

      protected PatternSet(org.gradle.api.tasks.util.internal.PatternSpecFactory patternSpecFactory)
  • Methodendetails

    • equals

      public boolean equals(@Nullable Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • copyFrom

      public PatternSet copyFrom(PatternFilterable sourcePattern)
    • doCopyFrom

      protected PatternSet doCopyFrom(PatternSet from)
    • intersect

      public PatternSet intersect()
    • isEmpty

      public boolean isEmpty()
      The PatternSet is considered empty when no includes or excludes have been added. The Spec returned by getAsSpec method only contains the default excludes patterns in this case.
      Gibt zurück:
      true when no includes or excludes have been added to this instance
    • getAsSpec

      public Spec<FileTreeElement> getAsSpec()
    • getAsIncludeSpec

      public Spec<FileTreeElement> getAsIncludeSpec()
    • getAsExcludeSpec

      public Spec<FileTreeElement> getAsExcludeSpec()
    • getIncludesView

      @Incubating public Set<String> getIncludesView()
      Like getIncludes(), but returns a unmodifiable view or empty set.

      Use this if you are only reading from the set, as it avoids allocating a set if not needed.

      Gibt zurück:
      the include patterns, or an empty set if none
      Seit:
      8.8
    • getIncludes

      public Set<String> getIncludes()
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Returns the set of include patterns.
      Angegeben von:
      getIncludes in Schnittstelle PatternFilterable
      Gibt zurück:
      The include patterns. Returns an empty set when there are no include patterns.
    • getIncludeSpecsView

      @Incubating public Set<Spec<FileTreeElement>> getIncludeSpecsView()
      Like getIncludeSpecs(), but returns a unmodifiable view or empty set.

      Use this if you are only reading from the set, as it avoids allocating a set if not needed.

      Gibt zurück:
      the include specs, or an empty set if none
      Seit:
      8.8
    • getIncludeSpecs

      public Set<Spec<FileTreeElement>> getIncludeSpecs()
    • setIncludes

      public PatternSet setIncludes(Iterable<String> includes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Set the allowable include patterns. Note that unlike PatternFilterable.include(Iterable) this replaces any previously defined includes.
      Angegeben von:
      setIncludes in Schnittstelle PatternFilterable
      Parameter:
      includes - an Iterable providing new include patterns
      Gibt zurück:
      this
      Siehe auch:
    • include

      public PatternSet include(String... includes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns to be processed.
      Angegeben von:
      include in Schnittstelle PatternFilterable
      Parameter:
      includes - a vararg list of include patterns
      Gibt zurück:
      this
      Siehe auch:
    • include

      public PatternSet include(Iterable includes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns to be processed.
      Angegeben von:
      include in Schnittstelle PatternFilterable
      Parameter:
      includes - a Iterable providing more include patterns
      Gibt zurück:
      this
      Siehe auch:
    • include

      public PatternSet include(Spec<FileTreeElement> spec)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an include spec. This method may be called multiple times to append new specs. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included.
      Angegeben von:
      include in Schnittstelle PatternFilterable
      Parameter:
      spec - the spec to add
      Gibt zurück:
      this
      Siehe auch:
    • getExcludesView

      @Incubating public Set<String> getExcludesView()
      Like getExcludes(), but returns a unmodifiable view or empty set.

      Use this if you are only reading from the set, as it avoids allocating a set if not needed.

      Gibt zurück:
      the exclude patterns, or an empty set if none
      Seit:
      8.8
    • getExcludes

      public Set<String> getExcludes()
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Returns the set of exclude patterns.
      Angegeben von:
      getExcludes in Schnittstelle PatternFilterable
      Gibt zurück:
      The exclude patterns. Returns an empty set when there are no exclude patterns.
    • getExcludeSpecsView

      @Incubating public Set<Spec<FileTreeElement>> getExcludeSpecsView()
      Like getExcludeSpecs(), but returns a unmodifiable view or empty set.

      Use this if you are only reading from the set, as it avoids allocating a set if not needed.

      Gibt zurück:
      the exclude specs, or an empty set if none
      Seit:
      8.8
    • getExcludeSpecs

      public Set<Spec<FileTreeElement>> getExcludeSpecs()
    • setExcludes

      public PatternSet setExcludes(Iterable<String> excludes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Set the allowable exclude patterns. Note that unlike PatternFilterable.exclude(Iterable) this replaces any previously defined excludes.
      Angegeben von:
      setExcludes in Schnittstelle PatternFilterable
      Parameter:
      excludes - an Iterable providing new exclude patterns
      Gibt zurück:
      this
      Siehe auch:
    • isCaseSensitive

      public boolean isCaseSensitive()
    • setCaseSensitive

      public void setCaseSensitive(boolean caseSensitive)
    • includeSpecs

      public PatternSet includeSpecs(Iterable<Spec<FileTreeElement>> includeSpecs)
    • include

      public PatternSet include(Closure closure)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a FileTreeElement as its parameter. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included.
      Angegeben von:
      include in Schnittstelle PatternFilterable
      Parameter:
      closure - the spec to add
      Gibt zurück:
      this
      Siehe auch:
    • exclude

      public PatternSet exclude(String... excludes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
      Angegeben von:
      exclude in Schnittstelle PatternFilterable
      Parameter:
      excludes - a vararg list of exclude patterns
      Gibt zurück:
      this
      Siehe auch:
    • exclude

      public PatternSet exclude(Iterable excludes)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
      Angegeben von:
      exclude in Schnittstelle PatternFilterable
      Parameter:
      excludes - a Iterable providing new exclude patterns
      Gibt zurück:
      this
      Siehe auch:
    • exclude

      public PatternSet exclude(Spec<FileTreeElement> spec)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an exclude spec. This method may be called multiple times to append new specs. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
      Angegeben von:
      exclude in Schnittstelle PatternFilterable
      Parameter:
      spec - the spec to add
      Gibt zurück:
      this
      Siehe auch:
    • excludeSpecs

      public PatternSet excludeSpecs(Iterable<Spec<FileTreeElement>> excludes)
    • exclude

      public PatternSet exclude(Closure closure)
      Beschreibung aus Schnittstelle kopiert: PatternFilterable
      Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a FileTreeElement as its parameter. The closure should return true or false. Example:
       copySpec {
         from 'source'
         into 'destination'
         //an example of excluding files from certain configuration:
         exclude { it.file in configurations.someConf.files }
       }
       
      If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
      Angegeben von:
      exclude in Schnittstelle PatternFilterable
      Parameter:
      closure - the spec to add
      Gibt zurück:
      this
      Siehe auch:
    • addToAntBuilder

      public Object addToAntBuilder(Object node, String childNodeName)
      Angegeben von:
      addToAntBuilder in Schnittstelle AntBuilderAware