Package yalp

Source Code of yalp.YalpBuilder

package yalp;


import yalp.classloading.ApplicationClasses;
import yalp.classloading.ApplicationClassloader;
import yalp.vfs.VirtualFile;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Properties;

/**
* Builder-pattern-builder for Yalp-class..
* <p/>
* It's kind of odd since Yalp only uses statics,
* But it basically inits the needed properties for Yalp-object to work in unittests
*/
public class YalpBuilder {

    public Properties configuration = new Properties();

    public YalpBuilder withConfiguration(Properties config) {
        this.configuration = config;
        return this;
    }


    @SuppressWarnings({"deprecation"})
    public void build() {

        Yalp.configuration = configuration;
        Yalp.classes = new ApplicationClasses();
        Yalp.javaPath = new ArrayList<VirtualFile>();
        Yalp.applicationPath = new File(".");
        Yalp.classloader = new ApplicationClassloader();
        Yalp.plugins = Collections.unmodifiableList(new ArrayList<YalpPlugin>());

    }
}
TOP

Related Classes of yalp.YalpBuilder

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.