Package eja.converters

Source Code of eja.converters.RoleConverter

package eja.converters;

import eja.ejb.entities.UserRole;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

/**
*
* @author fero
*/
public class RoleConverter implements Converter {


    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        UserRole role = new UserRole();
        role.setName(value);
       
        return role;
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
        UserRole role = (UserRole) value;
        return role.getName().toString();
    }

}
TOP

Related Classes of eja.converters.RoleConverter

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.