Package jetbrains.antlayout.datatypes

Source Code of jetbrains.antlayout.datatypes.DirContainer

package jetbrains.antlayout.datatypes;

import jetbrains.antlayout.util.TempFileFactory;
import jetbrains.antlayout.util.LayoutFileSet;

import java.util.ArrayList;
import java.util.List;

import org.apache.tools.ant.BuildException;

/**
* @author max
*/
public class DirContainer extends Container {
    private String dirName;

    public void setName(String name) {
        dirName = name;
    }

    public List<LayoutFileSet> build(TempFileFactory temp) {
        List<LayoutFileSet> unprefixed = super.build(temp);
        List<LayoutFileSet> prefixed = new ArrayList<LayoutFileSet>();

        for (LayoutFileSet set : unprefixed) {
            LayoutFileSet copy = createCopy(set);
            copy.setPrefix(dirName + "/" + set.getPrefix(getProject()));
            prefixed.add(copy);
        }

        return prefixed;
    }


    public void validateArguments() throws BuildException {
        super.validateArguments();
        if (dirName == null) {
            throw new BuildException("dirname attribute must be specified for direntry");
        }
    }
}
TOP

Related Classes of jetbrains.antlayout.datatypes.DirContainer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.