/** * Copyright (C) 2008-2010, Squale Project - http://www.squale.org * * This file is part of Squale. * * Squale is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or any later version. * * Squale is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Squale. If not, see <http://www.gnu.org/licenses/>. */ package org.squale.squaleweb.transformer.stats; import org.squale.squalecommon.datatransfertobject.stats.ProfilStatsDTO; import org.squale.squaleweb.applicationlayer.formbean.stats.ProfilStatsForm; import org.squale.welcom.struts.bean.WActionForm; import org.squale.welcom.struts.transformer.WITransformer; import org.squale.welcom.struts.transformer.WTransformerException; /** */ public class ProfileStatsTransformer implements WITransformer { /** * @param pObject le tableau d'objet contenant l'objet � transformer * @return le form r�sultat de la transformation * @throws WTransformerException en cas d'�chec */ public WActionForm objToForm( Object[] pObject ) throws WTransformerException { ProfilStatsForm form = new ProfilStatsForm(); objToForm( pObject, form ); return form; } /** * @param pObject le tableau d'objet contenant l'objet � transformer * @param pForm le form r�sultat * @throws WTransformerException en cas d'�chec */ public void objToForm( Object[] pObject, WActionForm pForm ) throws WTransformerException { ProfilStatsForm form = (ProfilStatsForm) pForm; ProfilStatsDTO dto = (ProfilStatsDTO) pObject[0]; form.setLoc( dto.getLoc() ); form.setNbProjects( dto.getNbProjects() ); form.setProfileName( dto.getProfileName() ); } /** * @deprecated n'a pas de sens * @param pForm le formulaire * @throws WTransformerException si un pb apparait. * @return rien mais lance syst�matiquement une exception */ public Object[] formToObj( WActionForm pForm ) throws WTransformerException { throw new WTransformerException( "deprecated" ); } /** * @deprecated n'a pas de sens * @param pForm le formulaire * @param pTab les param�tres * @throws WTransformerException si un pb apparait. */ public void formToObj( WActionForm pForm, Object[] pTab ) throws WTransformerException { throw new WTransformerException( "deprecated" ); } }