FileDocCategorySizeDatePackage
ContainerMapper.javaAPI DocApache Ant 1.703989Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.util

ContainerMapper

public abstract class ContainerMapper extends Object implements FileNameMapper
A FileNameMapper that contains other FileNameMappers.
see
FileNameMapper

Fields Summary
private List
mappers
Constructors Summary
Methods Summary
public synchronized voidadd(FileNameMapper fileNameMapper)
Add a FileNameMapper.

param
fileNameMapper a FileNameMapper.
throws
IllegalArgumentException if attempting to add this ContainerMapper to itself, or if the specified FileNameMapper is itself a ContainerMapper that contains this ContainerMapper.

        if (this == fileNameMapper
            || (fileNameMapper instanceof ContainerMapper
            && ((ContainerMapper) fileNameMapper).contains(this))) {
            throw new IllegalArgumentException(
                "Circular mapper containment condition detected");
        } else {
            mappers.add(fileNameMapper);
        }
    
public voidaddConfigured(FileNameMapper fileNameMapper)
An add configured version of the add method. This class used to contain an add method and an addConfiguredMapper method. Dur to ordering, the add method was always called first. This addConfigued method has been added to allow chaining to work correctly.

param
fileNameMapper a FileNameMapper.

        add(fileNameMapper);
    
public voidaddConfiguredMapper(org.apache.tools.ant.types.Mapper mapper)
Add a Mapper.

param
mapper the Mapper to add.


                  
        
        add(mapper.getImplementation());
    
protected synchronized booleancontains(FileNameMapper fileNameMapper)
Return true if this ContainerMapper or any of its sub-elements contains the specified FileNameMapper.

param
fileNameMapper the FileNameMapper to search for.
return
boolean.

        boolean foundit = false;
        for (Iterator iter = mappers.iterator(); iter.hasNext() && !foundit;) {
            FileNameMapper next = (FileNameMapper) (iter.next());
            foundit |= (next == fileNameMapper
                || (next instanceof ContainerMapper
                && ((ContainerMapper) next).contains(fileNameMapper)));
        }
        return foundit;
    
public synchronized java.util.ListgetMappers()
Get the List of FileNameMappers.

return
List.

        return Collections.unmodifiableList(mappers);
    
public voidsetFrom(java.lang.String ignore)
Empty implementation.

param
ignore ignored.

        //Empty
    
public voidsetTo(java.lang.String ignore)
Empty implementation.

param
ignore ignored.

        //Empty