Package sk.vrto.web.views.providers

Source Code of sk.vrto.web.views.providers.EmailViewProvider

package sk.vrto.web.views.providers;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import sk.vrto.domain.Email;
import sk.vrto.web.presenters.EmailPresenter;
import sk.vrto.web.views.EmailView;

@Component
public class EmailViewProvider implements ApplicationContextAware {

    private ApplicationContext applicationContext;

    public EmailView get(Email email) {
        return new EmailView(applicationContext.getBean(EmailPresenter.class), email);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

}
TOP

Related Classes of sk.vrto.web.views.providers.EmailViewProvider

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.