|
From: Leandro R. S. C. <bas...@us...> - 2004-03-22 21:34:25
|
Update of /cvsroot/xingu/xingu/exintake/src/java/br/com/ibnetwork/xingu/exintake In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31708/exintake/src/java/br/com/ibnetwork/xingu/exintake Added Files: IntakeHelper.java Intake.java IntakeException.java Log Message: adding Extensible input taker --- NEW FILE: Intake.java --- package br.com.ibnetwork.xingu.exintake; import org.apache.avalon.framework.component.Component; import br.com.ibnetwork.xingu.exintake.model.Group; /** * @author <a href="mailto:le...@ib...">Leandro Rodrigo Saad Cruz</a> * */ public interface Intake extends Component { public static final String ROLE = Intake.class.getName(); Group get(String groupName) throws IntakeException; String[] getGroupNames() throws IntakeException; } --- NEW FILE: IntakeHelper.java --- package br.com.ibnetwork.xingu.exintake; import java.util.Iterator; import java.util.List; import br.com.ibnetwork.xingu.exintake.model.Group; import br.com.ibnetwork.xingu.exintake.model.rule.RuleSet; /** * @author <a href="mailto:le...@ib...">Leandro Rodrigo Saad Cruz</a> * */ public class IntakeHelper { public static boolean isBeanValid(Group group, Object bean) throws IntakeException { List fieldNames = group.getFieldNames(); for (Iterator iter = fieldNames.iterator(); iter.hasNext();) { String fieldName = (String) iter.next(); RuleSet ruleSet = (RuleSet) group.get(fieldName); if (!ruleSet.isValid(bean)) { return false; } } return true; } } --- NEW FILE: IntakeException.java --- /* * Created on Dec 22, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package br.com.ibnetwork.xingu.exintake; import org.apache.commons.lang.exception.NestableException; /** * @author <a href="mailto:le...@ib...">Leandro Rodrigo Saad Cruz</a> * */ public class IntakeException extends NestableException { /** * */ public IntakeException() { super(); // TODO Auto-generated constructor stub } /** * @param arg0 */ public IntakeException(String arg0) { super(arg0); // TODO Auto-generated constructor stub } /** * @param arg0 */ public IntakeException(Throwable arg0) { super(arg0); // TODO Auto-generated constructor stub } /** * @param arg0 * @param arg1 */ public IntakeException(String arg0, Throwable arg1) { super(arg0, arg1); // TODO Auto-generated constructor stub } } |