Package com.vst.service.impl

Source Code of com.vst.service.impl.LookupManagerImpl

package com.vst.service.impl;

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

import com.vst.dao.LookupDao;
import com.vst.model.Role;
import com.vst.model.internal.LabelValue;
import com.vst.service.LookupManager;


/**
* Implementation of LookupManager interface to talk to the persistence layer.
*
* <p><a href="LookupManagerImpl.java.html"><i>View Source</i></a></p>
*
* @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
*/
public class LookupManagerImpl extends BaseManager implements LookupManager {
    //~ Instance fields ========================================================

    private LookupDao dao;

    //~ Methods ================================================================

    public void setLookupDao(LookupDao dao) {
//        super.dao = dao;
        this.dao = dao;
    }
    /**
     * @see com.vst.service.LookupManager#getAllRoles()
     */
    public List getAllRoles() {
        List roles = dao.getRoles();
        List list = new ArrayList();
        Role role = null;

        for (int i = 0; i < roles.size(); i++) {
            role = (Role) roles.get(i);
            list.add(new LabelValue(role.getName(), role.getName()));
        }

        return list;
    }
}
TOP

Related Classes of com.vst.service.impl.LookupManagerImpl

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.