/**
* 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.FactorsStatsDTO;
import org.squale.squaleweb.applicationlayer.formbean.stats.FactorsStatsForm;
import org.squale.welcom.struts.bean.WActionForm;
import org.squale.welcom.struts.transformer.WITransformer;
import org.squale.welcom.struts.transformer.WTransformerException;
/**
*/
public class FactorsStatsTransformer
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
{
FactorsStatsForm form = new FactorsStatsForm();
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
{
FactorsStatsForm form = (FactorsStatsForm) pForm;
FactorsStatsDTO dto = (FactorsStatsDTO) pObject[0];
form.setNbFactorsAccepted( dto.getNbFactorsAccepted() );
form.setNbFactorsRefused( dto.getNbFactorsRefused() );
form.setNbFactorsReserved( dto.getNbFactorsReserved() );
form.setNbTotal( dto.getNbTotal() );
}
/**
* @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" );
}
}