implemented getTransition(string)

This commit is contained in:
Keith Donald
2008-03-22 05:12:39 +00:00
parent 8ae70f00ef
commit e87b58a053
2 changed files with 16 additions and 0 deletions

View File

@@ -85,6 +85,14 @@ public class TransitionSet {
return transitions.size();
}
/**
* Returns an iterator over this transition set.
* @return an iterator
*/
public Iterator iterator() {
return transitions.iterator();
}
/**
* Convert this set to a typed transition array.
* @return the transition set as a typed array

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.webflow.engine;
import java.util.Iterator;
import org.springframework.core.style.StylerUtils;
import org.springframework.core.style.ToStringCreator;
import org.springframework.webflow.definition.TransitionDefinition;
@@ -62,6 +64,12 @@ public abstract class TransitionableState extends State implements Transitionabl
}
public TransitionDefinition getTransition(String eventId) {
for (Iterator it = transitions.iterator(); it.hasNext();) {
Transition transition = (Transition) it.next();
if (transition.getId().equals(eventId)) {
return transition;
}
}
return null;
}