FileDocCategorySizeDatePackage
CompositeMapper.javaAPI DocApache Ant 1.701803Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.util

CompositeMapper

public class CompositeMapper extends ContainerMapper
A ContainerMapper that unites the results of its constituent FileNameMappers into a single set of result filenames.

Fields Summary
Constructors Summary
Methods Summary
public java.lang.String[]mapFileName(java.lang.String sourceFileName)
{@inheritDoc}.

        HashSet results = new HashSet();

        FileNameMapper mapper = null;
        for (Iterator mIter = getMappers().iterator(); mIter.hasNext();) {
            mapper = (FileNameMapper) (mIter.next());
            if (mapper != null) {
                String[] mapped = mapper.mapFileName(sourceFileName);
                if (mapped != null) {
                    results.addAll(Arrays.asList(mapped));
                }
            }
        }
        return (results.size() == 0) ? null
            : (String[]) results.toArray(new String[results.size()]);