ARIManager.java :  » Web-Framework » RSF » uk » org » ponder » rsf » flow » support » Java Open Source

Java Open Source » Web Framework » RSF 
RSF » uk » org » ponder » rsf » flow » support » ARIManager.java
/*
 * Created on 07-May-2006
 */
package uk.org.ponder.rsf.flow.support;

import java.util.List;

import uk.org.ponder.rsf.flow.ARIResult;
import uk.org.ponder.rsf.flow.ActionResultInterpreter;
import uk.org.ponder.rsf.viewstate.ViewParameters;

/** An ARIResolver that will accept a list of primary resolvers which it
 * will poll in order. The first resolver that does not return <code>>null</code>
 * will have its result accepted.
 * @author Antranig Basman (amb26@ponder.org.uk)
 *
 */

public class ARIManager implements ActionResultInterpreter {

  private List arilist;

  public void setARIList(List arilist) {
    this.arilist = arilist;
  } 
  
  public ARIResult interpretActionResult(ViewParameters incoming, Object result) {
    for (int i = 0; i < arilist.size(); ++ i) {
      ActionResultInterpreter ari = (ActionResultInterpreter) arilist.get(i);
      ARIResult togo = ari.interpretActionResult(incoming, result);
      if (togo != null) return togo;
    }
    return null;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.