implemented getTransition(string)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user