MergingMapper (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util, class: MergingMapper

Package org.apache.tools.ant.util

# Class MergingMapper

java.lang.Object
org.apache.tools.ant.util.MergingMapper

All Implemented Interfaces:
  `FileNameMapper`

public class MergingMapper extends Object implements FileNameMapper
Implementation of FileNameMapper that always returns the same target file name.

This is the default FileNameMapper for the archiving tasks and uptodate.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String[]`
  `mergedFile`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MergingMapper()`
  `MergingMapper(String to)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `mapFileName(String sourceFileName)`
  Returns an one-element array containing the file name set via setTo.
  `void`
  `setFrom(String from)`
  Ignored.
  `void`
  `setTo(String to)`
  Sets the name of the merged file.

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

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

- ## Field Details

  - ### mergedFile

    protected String[] mergedFile

- ## Constructor Details

  - ### MergingMapper

    public MergingMapper()

  - ### MergingMapper

    public MergingMapper(String to)
    Parameters:
      `to` - String
    Since:
      Ant 1.8.0

- ## Method Details

  - ### setFrom

    public void setFrom(String from)
    Ignored.
    Specified by:
      `setFrom` in interface `FileNameMapper`
    Parameters:
      `from` - ignored.

  - ### setTo

    public void setTo(String to)
    Sets the name of the merged file.
    Specified by:
      `setTo` in interface `FileNameMapper`
    Parameters:
      `to` - the name of the merged file.

  - ### mapFileName

    public String[] mapFileName(String sourceFileName)
    Returns an one-element array containing the file name set via setTo.
    Specified by:
      `mapFileName` in interface `FileNameMapper`
    Parameters:
      `sourceFileName` - ignored.
    Returns:
      a one-element array containing the merged filename.