Link.PatternListEntry (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.modules, class: Link, class: PatternListEntry

Package org.apache.tools.ant.taskdefs.modules

# Class Link.PatternListEntry

java.lang.Object
org.apache.tools.ant.taskdefs.modules.Link.PatternListEntry

Enclosing class:
  Link

    public class Link.PatternListEntry
    extends java.lang.Object

Child element type which specifies a jlink files pattern. Each instance may specify a string PathMatcher pattern or a text file containing a list of such patterns, one per line.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `PatternListEntry()` | Creates an unconfigured element.
  `PatternListEntry​(java.lang.String pattern)` | Creates a new element from either a pattern or listing file.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.io.File` | `getListFile()` | Returns this element's list file attribute, if set.
  `java.lang.String` | `getPattern()` | Returns this element's PathMatcher pattern attribute, if set.
  `void` | `setListFile​(java.io.File file)` | Sets this element's list file attribute.
  `void` | `setPattern​(java.lang.String pattern)` | Sets this element's PathMatcher pattern attribute for matching files.
  `java.lang.String` | `toOptionValue()` | Converts this element to a jlink command line attribute, either this element's bare pattern, or its list file preceded by "`@`".
  `void` | `validate()` | Verifies this element's state.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PatternListEntry

    public PatternListEntry()
    Creates an unconfigured element.

  - ### PatternListEntry

    public PatternListEntry​(java.lang.String pattern)
    Creates a new element from either a pattern or listing file. If the argument starts with "`@`", the remainder of it is assumed to be a listing file; otherwise, it is treated as a PathMatcher pattern.
    Parameters:
      `pattern` - a PathMatcher pattern or `@`-filename

- ## Method Details

  - ### getPattern

    public java.lang.String getPattern()
    Returns this element's PathMatcher pattern attribute, if set.
    Returns:
      this element's files pattern

  - ### setPattern

    public void setPattern​(java.lang.String pattern)
    Sets this element's PathMatcher pattern attribute for matching files.
    Parameters:
      `pattern` - new files pattern

  - ### getListFile

    public java.io.File getListFile()
    Returns this element's list file attribute, if set.
    Returns:
      this element's list file
    See Also:
      `setListFile(File)`

  - ### setListFile

    public void setListFile​(java.io.File file)
    Sets this element's list file attribute. The file must be a plain text file with one PathMatcher pattern per line.
    Parameters:
      `file` - list file containing patterns
    See Also:
      `getListFile()`

  - ### validate

    public void validate()
    Verifies this element's state.
    Throws:
      `BuildException` - if both pattern and file are set
      `BuildException` - if neither pattern nor file is set

  - ### toOptionValue

    public java.lang.String toOptionValue()
    Converts this element to a jlink command line attribute, either this element's bare pattern, or its list file preceded by "`@`".
    Returns:
      this element's information converted to a command line value