You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ra...@apache.org on 2005/08/10 23:11:40 UTC

svn commit: r231329 [13/13] - in /jakarta/taglibs/proper/rdc/trunk/src: META-INF/tags/rdc/ org/apache/taglibs/rdc/ org/apache/taglibs/rdc/core/ org/apache/taglibs/rdc/dm/ org/apache/taglibs/rdc/resources/ org/apache/taglibs/rdc/sampleapps/mortgage/ org...

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/SCXML.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/SCXML.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/SCXML.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/SCXML.java Wed Aug 10 14:10:59 2005
@@ -41,30 +41,30 @@
     /**
      * The SCXML XMLNS
      */
-	public static final String XMLNS = "http://www.w3.org/2005/01/SCXML";
-	
+    public static final String XMLNS = "http://www.w3.org/2005/01/SCXML";
+    
     /**
      * The xmlns attribute on the root <smxml> element.
      * This must match XMLNS above.
      */
-	private String xmlns;
-	
+    private String xmlns;
+    
     /**
      * The SCXML version of this document.
      */
-	private String version;
+    private String version;
 
     /**
      * The initial State for the SCXML executor
      */
-	private State initialState;
+    private State initialState;
 
     /**
      * The initial state ID (used by XML Digester only)
      */
-	private transient String initialstate;
+    private transient String initialstate;
 
-	/**
+    /**
      * The immediate child states of this SCXML document root
      */
     private Map states;
@@ -74,167 +74,167 @@
      */
     private NotificationRegistry notifReg;
 
-	/**
+    /**
      * A global map of all States and Parallels associated with this
      * state machine, keyed by their id 
      */
     private Map targets;
 
-	/**
-	 * The root Context which interfaces with the host environment
-	 */
-	private Context rootContext;
-	
-	/**
-	 * Constructor
-	 */
-	public SCXML() { 
-		this.states = new HashMap();
-		this.notifReg = new NotificationRegistry();
-		this.targets = new HashMap();
-	}
-	
-	/**
-	 * Get the initial State
-	 * 
-	 * @return Returns the initialstate.
-	 */
-	public State getInitialState() {
-		return initialState;
-	}
-	
-	/**
-	 * Set the initial State
-	 * 
-	 * @param initialstate The initialstate to set.
-	 */
-	public void setInitialState(State initialState) {
-		this.initialState = initialState;
-	}
-	
-	/**
-	 * Get the children states
-	 * 
-	 * @return Returns the states.
-	 */
-	public Map getStates() {
-		return states;
-	}
-	
-	/**
-	 * Add a child state
-	 * 
-	 * @param state The state to be added to the states Map.
-	 */
-	public void addState(State state) {
-		states.put(state.getId(), state);
-	}
-	
-	/**
-	 * Get the targets map, whichis a Map of all States and Parallels 
-	 * associated with this state machine, keyed by their id
-	 * 
-	 * @return Returns the targets.
-	 */
-	public Map getTargets() {
-		return targets;
-	}
-	
-	/**
-	 * Add a target to this SCXML document
-	 * 
-	 * @param target The target to be added to the targets Map.
-	 */
-	public void addTarget(TransitionTarget target) {
-		String id = target.getId();
-		if (!SCXMLHelper.isStringEmpty(id)) {
-			// Target is not anonymous, so makes sense to map it
-			targets.put(id, target);
-		}
-	}	
-	
-	/**
-	 * Get the SCXML document version
-	 * 
-	 * @return Returns the version.
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Set the SCXML document version
-	 * 
-	 * @param version The version to set.
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	
-	/**
-	 * Get the xmlns of this SCXML document
-	 * 
-	 * @return Returns the xmlns.
-	 */
-	public String getXmlns() {
-		return xmlns;
-	}
-	
-	/**
-	 * Set the xmlns of this SCXML document
-	 * 
-	 * @param xmlns The xmlns to set.
-	 */
-	public void setXmlns(String xmlns) {
-		this.xmlns = xmlns;
-	}
-
-	/**
-	 * Get the notification registry
-	 * 
-	 * @return Returns the notifReg.
-	 */
-	public NotificationRegistry getNotificationRegistry() {
-		return notifReg;
-	}
-	
-	/**
-	 * Get the ID of the initial state
-	 * 
-	 * @return Returns the initial state ID (used by XML Digester only).
-	 * @see #getInitialState()
-	 */
-	public String getInitialstate() {
-		return initialstate;
-	}
-	
-	/**
-	 * Set the ID of the initial state
-	 * 
-	 * @param initialstate The initial state ID (used by XML Digester only).
-	 * @see #setInitialState(State)
-	 */
-	public void setInitialstate(String initialstate) {
-		this.initialstate = initialstate;
-	}
-	
-	/**
-	 * Get the root Context for this document
-	 * 
-	 * @return Returns the rootContext.
-	 */
-	public Context getRootContext() {
-		return rootContext;
-	}
-	
-	/**
-	 * Set the root Context for this document
-	 * 
-	 * @param rootContext The rootContext to set.
-	 */
-	public void setRootContext(Context rootContext) {
-		this.rootContext = rootContext;
-	}
+    /**
+     * The root Context which interfaces with the host environment
+     */
+    private Context rootContext;
+    
+    /**
+     * Constructor
+     */
+    public SCXML() { 
+        this.states = new HashMap();
+        this.notifReg = new NotificationRegistry();
+        this.targets = new HashMap();
+    }
+    
+    /**
+     * Get the initial State
+     * 
+     * @return Returns the initialstate.
+     */
+    public State getInitialState() {
+        return initialState;
+    }
+    
+    /**
+     * Set the initial State
+     * 
+     * @param initialstate The initialstate to set.
+     */
+    public void setInitialState(State initialState) {
+        this.initialState = initialState;
+    }
+    
+    /**
+     * Get the children states
+     * 
+     * @return Returns the states.
+     */
+    public Map getStates() {
+        return states;
+    }
+    
+    /**
+     * Add a child state
+     * 
+     * @param state The state to be added to the states Map.
+     */
+    public void addState(State state) {
+        states.put(state.getId(), state);
+    }
+    
+    /**
+     * Get the targets map, whichis a Map of all States and Parallels 
+     * associated with this state machine, keyed by their id
+     * 
+     * @return Returns the targets.
+     */
+    public Map getTargets() {
+        return targets;
+    }
+    
+    /**
+     * Add a target to this SCXML document
+     * 
+     * @param target The target to be added to the targets Map.
+     */
+    public void addTarget(TransitionTarget target) {
+        String id = target.getId();
+        if (!SCXMLHelper.isStringEmpty(id)) {
+            // Target is not anonymous, so makes sense to map it
+            targets.put(id, target);
+        }
+    }    
+    
+    /**
+     * Get the SCXML document version
+     * 
+     * @return Returns the version.
+     */
+    public String getVersion() {
+        return version;
+    }
+    
+    /**
+     * Set the SCXML document version
+     * 
+     * @param version The version to set.
+     */
+    public void setVersion(String version) {
+        this.version = version;
+    }
+    
+    /**
+     * Get the xmlns of this SCXML document
+     * 
+     * @return Returns the xmlns.
+     */
+    public String getXmlns() {
+        return xmlns;
+    }
+    
+    /**
+     * Set the xmlns of this SCXML document
+     * 
+     * @param xmlns The xmlns to set.
+     */
+    public void setXmlns(String xmlns) {
+        this.xmlns = xmlns;
+    }
+
+    /**
+     * Get the notification registry
+     * 
+     * @return Returns the notifReg.
+     */
+    public NotificationRegistry getNotificationRegistry() {
+        return notifReg;
+    }
+    
+    /**
+     * Get the ID of the initial state
+     * 
+     * @return Returns the initial state ID (used by XML Digester only).
+     * @see #getInitialState()
+     */
+    public String getInitialstate() {
+        return initialstate;
+    }
+    
+    /**
+     * Set the ID of the initial state
+     * 
+     * @param initialstate The initial state ID (used by XML Digester only).
+     * @see #setInitialState(State)
+     */
+    public void setInitialstate(String initialstate) {
+        this.initialstate = initialstate;
+    }
+    
+    /**
+     * Get the root Context for this document
+     * 
+     * @return Returns the rootContext.
+     */
+    public Context getRootContext() {
+        return rootContext;
+    }
+    
+    /**
+     * Set the root Context for this document
+     * 
+     * @param rootContext The rootContext to set.
+     */
+    public void setRootContext(Context rootContext) {
+        this.rootContext = rootContext;
+    }
 
     /**
      * Register a listener to this document root
@@ -253,7 +253,7 @@
      * Remarks: Only valid if StateMachine is non null!
      */
     public void removeListener(SCXMLListener lst) {
-    	notifReg.removeListener(this, lst);
+        notifReg.removeListener(this, lst);
     }
-	
+    
 }

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Send.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Send.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Send.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Send.java Wed Aug 10 14:10:59 2005
@@ -28,167 +28,167 @@
  * @author Jaroslav Gergic
  */
 public class Send extends Action {
-	
+    
     /**
      * The ID of the send message
      */
-	private String sendId;
-	
-	/**
+    private String sendId;
+    
+    /**
      * An expression returning the target location of the event
      */
-	private String target;
+    private String target;
 
     /**
      * The type of the Event I/O Processor that the event
-	 * should be dispatched to
+     * should be dispatched to
      */
-	private String targetType;
+    private String targetType;
 
     /**
      * The event is dispatched after the delay interval elapses
      */
-	private String delay;
+    private String delay;
 
     /**
      * The data containing information which may be used by the 
      * implementing platform to configure the event processor
      */
-	private String hints;
+    private String hints;
 
     /**
      * The namelist to the sent
      */
-	private String namelist;
+    private String namelist;
 
     /**
      * The list of external nodes associated with this <send> element
      */
-	private List externalNodes;
+    private List externalNodes;
 
     /**
      * The type of event being generated
      */
-	private String event;
-	
-	/**
-	 * Constructor
-	 */
-	public Send() {
-		super();
-		this.externalNodes = new ArrayList();
-	}
-	
-	/**
-	 * @return Returns the delay.
-	 */
-	public String getDelay() {
-		return delay;
-	}
-	
-	/**
-	 * @param delay The delay to set.
-	 */
-	public void setDelay(String delay) {
-		this.delay = delay;
-	}
-	
-	/**
-	 * @return Returns the externalnode.
-	 */
-	public List getExternalNodes() {
-		return externalNodes;
-	}
-	
-	/**
-	 * @param externalnode The externalnode to set.
-	 */
-	public void setExternalNodes(List externalNodes) {
-		this.externalNodes = externalNodes;
-	}
-	
-	/**
-	 * @return Returns the hints.
-	 */
-	public String getHints() {
-		return hints;
-	}
-	
-	/**
-	 * @param hints The hints to set.
-	 */
-	public void setHints(String hints) {
-		this.hints = hints;
-	}
-	
-	/**
-	 * @return Returns the namelist.
-	 */
-	public String getNamelist() {
-		return namelist;
-	}
-	
-	/**
-	 * @param namelist The namelist to set.
-	 */
-	public void setNamelist(String namelist) {
-		this.namelist = namelist;
-	}
-	
-	/**
-	 * @return Returns the sendId.
-	 */
-	public String getSendId() {
-		return sendId;
-	}
-	
-	/**
-	 * @param sendId The sendId to set.
-	 */
-	public void setSendId(String sendId) {
-		this.sendId = sendId;
-	}
-	
-	/**
-	 * @return Returns the target.
-	 */
-	public String getTarget() {
-		return target;
-	}
-	
-	/**
-	 * @param target The target to set.
-	 */
-	public void setTarget(String target) {
-		this.target = target;
-	}
-	
-	/**
-	 * @return Returns the targetType.
-	 */
-	public String getTargetType() {
-		return targetType;
-	}
-	
-	/**
-	 * @param targetType The targetType to set.
-	 */
-	public void setTargetType(String targetType) {
-		this.targetType = targetType;
-	}
-
-	/**
-	 * @param event The event to set.
-	 */
-	public void setEvent(String event) {
-		this.event = event;
-	}
-
-	/**
-	 * @return Returns the event.
-	 */
-	public String getEvent() {
-		return event;
-	}
-	
+    private String event;
+    
+    /**
+     * Constructor
+     */
+    public Send() {
+        super();
+        this.externalNodes = new ArrayList();
+    }
+    
+    /**
+     * @return Returns the delay.
+     */
+    public String getDelay() {
+        return delay;
+    }
+    
+    /**
+     * @param delay The delay to set.
+     */
+    public void setDelay(String delay) {
+        this.delay = delay;
+    }
+    
+    /**
+     * @return Returns the externalnode.
+     */
+    public List getExternalNodes() {
+        return externalNodes;
+    }
+    
+    /**
+     * @param externalnode The externalnode to set.
+     */
+    public void setExternalNodes(List externalNodes) {
+        this.externalNodes = externalNodes;
+    }
+    
+    /**
+     * @return Returns the hints.
+     */
+    public String getHints() {
+        return hints;
+    }
+    
+    /**
+     * @param hints The hints to set.
+     */
+    public void setHints(String hints) {
+        this.hints = hints;
+    }
+    
+    /**
+     * @return Returns the namelist.
+     */
+    public String getNamelist() {
+        return namelist;
+    }
+    
+    /**
+     * @param namelist The namelist to set.
+     */
+    public void setNamelist(String namelist) {
+        this.namelist = namelist;
+    }
+    
+    /**
+     * @return Returns the sendId.
+     */
+    public String getSendId() {
+        return sendId;
+    }
+    
+    /**
+     * @param sendId The sendId to set.
+     */
+    public void setSendId(String sendId) {
+        this.sendId = sendId;
+    }
+    
+    /**
+     * @return Returns the target.
+     */
+    public String getTarget() {
+        return target;
+    }
+    
+    /**
+     * @param target The target to set.
+     */
+    public void setTarget(String target) {
+        this.target = target;
+    }
+    
+    /**
+     * @return Returns the targetType.
+     */
+    public String getTargetType() {
+        return targetType;
+    }
+    
+    /**
+     * @param targetType The targetType to set.
+     */
+    public void setTargetType(String targetType) {
+        this.targetType = targetType;
+    }
+
+    /**
+     * @param event The event to set.
+     */
+    public void setEvent(String event) {
+        this.event = event;
+    }
+
+    /**
+     * @return Returns the event.
+     */
+    public String getEvent() {
+        return event;
+    }
+    
 }

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/State.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/State.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/State.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/State.java Wed Aug 10 14:10:59 2005
@@ -34,297 +34,297 @@
  */
 public class State extends TransitionTarget {
 
-	/**
-	 * The Context in which any expressions will be evaluated
-	 */
-	private Context context;
-
-	/**
-	 * The Map containing immediate children of this State, keyed by 
-	 * their IDs. Incompatible with the parallel property.
-	 */
-	private Map children;
-
-	/**
-	 * The Parallel child, which defines a set of parallel substates. 
-	 * May occur 0 or 1 times. Incompatible with the state property.
-	 */
-	private Parallel parallel;
-
-	/**
-	 * Boolean property indicating whether this is a final state or not. 
-	 * Default value is false . Final states may not have substates or 
-	 * outgoing transitions.
-	 */
-	private boolean isFinal;
-
-	/**
-	 * A child which identifies initial state for state machines that 
-	 * have substates.
-	 */
-	private Initial initial;
-
-	/**
-	 * A map of outgoing Transitions from this state
-	 */
-	private Map transitions;
-
-	/**
-	 * List of history states owned by a given state (applies to non-leaf
-	 * states)
-	 */
-	private List history;
-	
-	/**
-	 * Applies to composite states only. If one of its final children is 
-	 * active, its parent is marked done. This property is reset upon
-	 * re-entry.
-	 */
-	private boolean done = false;
-
-	/**
-	 * Constructor
-	 */
-	public State() {
-		this.children = new HashMap();
-		this.transitions = new HashMap();
-		this.history = new ArrayList();
-	}
-
-	/**
-	 * Get the Context
-	 * 
-	 * @return Returns the context.
-	 */
-	public Context getContext() {
-		return context;
-	}
-
-	/**
-	 * Set the Context
-	 * 
-	 * @param context
-	 *            The context to set.
-	 */
-	public void setContext(Context context) {
-		this.context = context;
-	}
-
-	/**
-	 * Is this state a "final" state
-	 * 
-	 * @return Returns the isFinal.
-	 */
-	public boolean getIsFinal() {
-		return isFinal;
-	}
-
-	/**
-	 * Set whether this is a "final" state
-	 * 
-	 * @param isFinal
-	 *            The isFinal to set.
-	 */
-	public void setIsFinal(boolean isFinal) {
-		this.isFinal = isFinal;
-	}
-
-	/**
-	 * Get the Parallel child (may be null)
-	 * 
-	 * @return Returns the parallel.
-	 */
-	public Parallel getParallel() {
-		return parallel;
-	}
-
-	/**
-	 * Set the Parallel child 
-	 * 
-	 * @param parallel
-	 *            The parallel to set.
-	 */
-	public void setParallel(Parallel parallel) {
-		this.parallel = parallel;
-	}
-
-	/**
-	 * Get the initial state
-	 * 
-	 * @return Returns the target.
-	 */
-	public Initial getInitial() {
-		return initial;
-	}
-
-	/**
-	 * Set the initial state
-	 * 
-	 * @param target
-	 *            The target to set.
-	 */
-	public void setInitial(Initial target) {
-		this.initial = target;
-	}
-
-	/**
-	 * Get the map of all outgoing transitions from this state
-	 * 
-	 * @return Returns the transitions Map.
-	 */
-	public Map getTransitions() {
-		return transitions;
-	}
-
-	/**
-	 * Get the map of all outgoing transitions from this state, which
-	 * will be fired on the given event.
-	 * 
-	 * @return Returns the transition for given event.
-	 */
-	public Transition getTransition(String event) {
-		return (Transition) transitions.get(event);
-	}
-
-	/**
-	 * Add a transition to the map of all outgoing transitions for
-	 * this state
-	 * 
-	 * @param transition
-	 *            The transitions to set.
-	 */
-	public void addTransition(Transition transition) {
-		String event = transition.getEvent();
-		if (!transitions.containsKey(event)) {
-			List eventTransitions = new ArrayList();
-			eventTransitions.add(transition);
-			transitions.put(event, eventTransitions);
-		} else {
-			((List) transitions.get(event)).add(transition);
-		}
-	}
-
-	/**
-	 * Get the map of child states (may be empty)
-	 * 
-	 * @return Returns the children.
-	 */
-	public Map getChildren() {
-		return children;
-	}
-
-	/**
-	 * Add a child state
-	 * 
-	 * @param state
-	 *            a child state
-	 */
-	public void addChild(State state) {
-		this.children.put(state.getId(), state);
-		state.setParent(this);
-	}
-
-	/**
-	 * Get the outgoing transitions for this state as a java.util.List
-	 * 
-	 * @return Returns the transitions (as a list). TODO - Check in next
-	 *         iteration whether both methods need to be retained.
-	 */
-	public List getTransitionsList() {
-		// Each call creates a new List, this will change once TO-DO is handled
-		List transitionsList = new ArrayList();
-		for (Iterator iter = transitions.keySet().iterator(); iter.hasNext();) {
-			transitionsList.addAll((List) transitions.get(iter.next()));
-		}
-		return transitionsList;
-	}
-
-	/**
-	 * This method is used by XML digester
-	 * 
-	 * @param h
-	 *            History pseudo state
-	 */
-	public void addHistory(History h) {
-		history.add(h);
-	}
-
-	/**
-	 * Does this state have a history pseudo state
-	 * 
-	 * @return true if a given state contains at least one history pseudo state
-	 */
-	public boolean hasHistory() {
-		return (!history.isEmpty());
-	}
-
-	/**
-	 * Get the list of history pseudo states for this state
-	 * 
-	 * @return a list of all history pseudo states contained by a given state
-	 *         (can be empty)
-	 * @see #hasHistory()
-	 */
-	public List getHistory() {
-		return history;
-	}
-
-	/**
-	 * Check whether this is a simple (leaf) state (UML terminology) 
-	 *  
-	 * @return true if this is a simple state, otherwise false
-	 */
-	public final boolean isSimple() {
-		return (parallel == null && children.isEmpty()) ? true : false;
-	}
-
-	/** 
-	 * Check whether this is a composite state (UML terminology) 
-	 *
-	 * @return true if this is a composite state, otherwise false
-	 */
-	public final boolean isComposite() {
-		return (parallel == null && children.isEmpty()) ? false : true;
-	}
-
-	/**
-	 * Checks whether it is a region state (directly nested to parallel - UML
-	 * terminology)
-	 * 
-	 * @return true if this is a region state, otherwise false
-	 * @see Parallel
-	 */
-	public final boolean isRegion() {
-		return (getParent() instanceof Parallel) ? true : false;
-	}
-
-	/**
-	 * Checks whether it is a orthogonal state, that is, it owns a parallel
-	 * (UML terminology)
-	 * 
-	 * @return true if this is a orthogonal state, otherwise false
-	 */
-	public final boolean isOrthogonal() {
-		return (parallel != null) ? true : false;
-	}
-	
-	/**
-	 * In case this is a parallel state, check if one its final states
-	 * is active.
-	 * 
-	 * @return Returns the done.
-	 */
-	public boolean isDone() {
-		return done;
-	}
-	
-	/**
-	 * Update the done property, which is set if this is a parallel state,
-	 * and one its final states is active.
-	 * 
-	 * @param done The done to set.
-	 */
-	public void setDone(boolean done) {
-		this.done = done;
-	}
+    /**
+     * The Context in which any expressions will be evaluated
+     */
+    private Context context;
+
+    /**
+     * The Map containing immediate children of this State, keyed by 
+     * their IDs. Incompatible with the parallel property.
+     */
+    private Map children;
+
+    /**
+     * The Parallel child, which defines a set of parallel substates. 
+     * May occur 0 or 1 times. Incompatible with the state property.
+     */
+    private Parallel parallel;
+
+    /**
+     * Boolean property indicating whether this is a final state or not. 
+     * Default value is false . Final states may not have substates or 
+     * outgoing transitions.
+     */
+    private boolean isFinal;
+
+    /**
+     * A child which identifies initial state for state machines that 
+     * have substates.
+     */
+    private Initial initial;
+
+    /**
+     * A map of outgoing Transitions from this state
+     */
+    private Map transitions;
+
+    /**
+     * List of history states owned by a given state (applies to non-leaf
+     * states)
+     */
+    private List history;
+    
+    /**
+     * Applies to composite states only. If one of its final children is 
+     * active, its parent is marked done. This property is reset upon
+     * re-entry.
+     */
+    private boolean done = false;
+
+    /**
+     * Constructor
+     */
+    public State() {
+        this.children = new HashMap();
+        this.transitions = new HashMap();
+        this.history = new ArrayList();
+    }
+
+    /**
+     * Get the Context
+     * 
+     * @return Returns the context.
+     */
+    public Context getContext() {
+        return context;
+    }
+
+    /**
+     * Set the Context
+     * 
+     * @param context
+     *            The context to set.
+     */
+    public void setContext(Context context) {
+        this.context = context;
+    }
+
+    /**
+     * Is this state a "final" state
+     * 
+     * @return Returns the isFinal.
+     */
+    public boolean getIsFinal() {
+        return isFinal;
+    }
+
+    /**
+     * Set whether this is a "final" state
+     * 
+     * @param isFinal
+     *            The isFinal to set.
+     */
+    public void setIsFinal(boolean isFinal) {
+        this.isFinal = isFinal;
+    }
+
+    /**
+     * Get the Parallel child (may be null)
+     * 
+     * @return Returns the parallel.
+     */
+    public Parallel getParallel() {
+        return parallel;
+    }
+
+    /**
+     * Set the Parallel child 
+     * 
+     * @param parallel
+     *            The parallel to set.
+     */
+    public void setParallel(Parallel parallel) {
+        this.parallel = parallel;
+    }
+
+    /**
+     * Get the initial state
+     * 
+     * @return Returns the target.
+     */
+    public Initial getInitial() {
+        return initial;
+    }
+
+    /**
+     * Set the initial state
+     * 
+     * @param target
+     *            The target to set.
+     */
+    public void setInitial(Initial target) {
+        this.initial = target;
+    }
+
+    /**
+     * Get the map of all outgoing transitions from this state
+     * 
+     * @return Returns the transitions Map.
+     */
+    public Map getTransitions() {
+        return transitions;
+    }
+
+    /**
+     * Get the map of all outgoing transitions from this state, which
+     * will be fired on the given event.
+     * 
+     * @return Returns the transition for given event.
+     */
+    public Transition getTransition(String event) {
+        return (Transition) transitions.get(event);
+    }
+
+    /**
+     * Add a transition to the map of all outgoing transitions for
+     * this state
+     * 
+     * @param transition
+     *            The transitions to set.
+     */
+    public void addTransition(Transition transition) {
+        String event = transition.getEvent();
+        if (!transitions.containsKey(event)) {
+            List eventTransitions = new ArrayList();
+            eventTransitions.add(transition);
+            transitions.put(event, eventTransitions);
+        } else {
+            ((List) transitions.get(event)).add(transition);
+        }
+    }
+
+    /**
+     * Get the map of child states (may be empty)
+     * 
+     * @return Returns the children.
+     */
+    public Map getChildren() {
+        return children;
+    }
+
+    /**
+     * Add a child state
+     * 
+     * @param state
+     *            a child state
+     */
+    public void addChild(State state) {
+        this.children.put(state.getId(), state);
+        state.setParent(this);
+    }
+
+    /**
+     * Get the outgoing transitions for this state as a java.util.List
+     * 
+     * @return Returns the transitions (as a list). TODO - Check in next
+     *         iteration whether both methods need to be retained.
+     */
+    public List getTransitionsList() {
+        // Each call creates a new List, this will change once TO-DO is handled
+        List transitionsList = new ArrayList();
+        for (Iterator iter = transitions.keySet().iterator(); iter.hasNext();) {
+            transitionsList.addAll((List) transitions.get(iter.next()));
+        }
+        return transitionsList;
+    }
+
+    /**
+     * This method is used by XML digester
+     * 
+     * @param h
+     *            History pseudo state
+     */
+    public void addHistory(History h) {
+        history.add(h);
+    }
+
+    /**
+     * Does this state have a history pseudo state
+     * 
+     * @return true if a given state contains at least one history pseudo state
+     */
+    public boolean hasHistory() {
+        return (!history.isEmpty());
+    }
+
+    /**
+     * Get the list of history pseudo states for this state
+     * 
+     * @return a list of all history pseudo states contained by a given state
+     *         (can be empty)
+     * @see #hasHistory()
+     */
+    public List getHistory() {
+        return history;
+    }
+
+    /**
+     * Check whether this is a simple (leaf) state (UML terminology) 
+     *  
+     * @return true if this is a simple state, otherwise false
+     */
+    public final boolean isSimple() {
+        return (parallel == null && children.isEmpty()) ? true : false;
+    }
+
+    /** 
+     * Check whether this is a composite state (UML terminology) 
+     *
+     * @return true if this is a composite state, otherwise false
+     */
+    public final boolean isComposite() {
+        return (parallel == null && children.isEmpty()) ? false : true;
+    }
+
+    /**
+     * Checks whether it is a region state (directly nested to parallel - UML
+     * terminology)
+     * 
+     * @return true if this is a region state, otherwise false
+     * @see Parallel
+     */
+    public final boolean isRegion() {
+        return (getParent() instanceof Parallel) ? true : false;
+    }
+
+    /**
+     * Checks whether it is a orthogonal state, that is, it owns a parallel
+     * (UML terminology)
+     * 
+     * @return true if this is a orthogonal state, otherwise false
+     */
+    public final boolean isOrthogonal() {
+        return (parallel != null) ? true : false;
+    }
+    
+    /**
+     * In case this is a parallel state, check if one its final states
+     * is active.
+     * 
+     * @return Returns the done.
+     */
+    public boolean isDone() {
+        return done;
+    }
+    
+    /**
+     * Update the done property, which is set if this is a parallel state,
+     * and one its final states is active.
+     * 
+     * @param done The done to set.
+     */
+    public void setDone(boolean done) {
+        this.done = done;
+    }
 }

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Transition.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Transition.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Transition.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Transition.java Wed Aug 10 14:10:59 2005
@@ -31,28 +31,28 @@
  * @author Jaroslav Gergic
  */
 public class Transition extends Executable implements Observable {
-	
+    
     /**
      * Property that specifies the trigger for this transition.
      */
-	private String event;
+    private String event;
 
     /**
      * Optional guard condition.
      */
-	private String cond;
+    private String cond;
 
     /**
      * Optional property that specifies the new state or parallel 
      * element to transition to. May be specified by reference or in-line.
      */
-	private TransitionTarget target;
+    private TransitionTarget target;
 
     /**
      * The transition target ID (used by XML Digester only)
      */
-	private String next;
-	
+    private String next;
+    
     /**
      * The notification registry.
      */
@@ -62,13 +62,13 @@
      * The path for this transition.
      * @see Path
      */    
-	private Path path = null;
-	
-	/**
-	 * Constructor
-	 */
+    private Path path = null;
+    
+    /**
+     * Constructor
+     */
     public Transition() {
-    	super();
+        super();
     }
 
     /**
@@ -89,129 +89,129 @@
         notifReg.removeListener(this, lst);
     }
 
-	/**
-	 * Get the guard condition (may be null)
-	 * 
-	 * @return Returns the cond.
-	 */
-	public String getCond() {
-		return cond;
-	}
-	
-	/**
-	 * Set the guard condition
-	 * 
-	 * @param cond The cond to set.
-	 */
-	public void setCond(String cond) {
-		this.cond = cond;
-	}
-	
-	/**
-	 * Get the event that will trigger this transition (pending 
-	 * evaluation of the guard condition in favor)
-	 * 
-	 * @return Returns the event.
-	 */
-	public String getEvent() {
-		return event;
-	}
-	
-	/**
-	 * Set the event that will trigger this transition (pending 
-	 * evaluation of the guard condition in favor)
-	 * 
-	 * @param event The event to set.
-	 */
-	public void setEvent(String event) {
-		this.event = event;
-	}
-	
-	/**
-	 * Get the transition target (may be null)
-	 * 
-	 * @return Returns the target as specified in SCXML markup.
-	 * <p>Remarks: Is <code>null</code> for &quot;stay&quot; transitions.
-	 *  Returns parent (the source node) for &quot;self&quot; transitions.</p>
-	 */
-	public TransitionTarget getTarget() {
-		return target;
-	}
-	
-	/**
-	 * Get the runtime transition target, which always resolves to
-	 * a TransitionTarget instance.
-	 * 
-	 * @return Returns the actual target of a transition at runtime.
-	 * <p>Remarks: For both the &quot;stay&quot; and &quot;self&quot; 
-	 * transitions it returns parent (the source node). This method should 
-	 * never return <code>null</code>.</p>
-	 */
-	public TransitionTarget getRuntimeTarget() {
-		return (target != null) ? target : parent;
-	}
-
-	
-	/**
-	 * Set the transition target
-	 * 
-	 * @param target The target to set.
-	 */
-	public void setTarget(TransitionTarget target) {
-		this.target = target;
-	}
-	
-	/**
-	 * Get the ID of the transition target (may be null, if, for example,
-	 * the target is specified inline)
-	 * 
-	 * @return Returns the transition target ID (used by SCXML Digester only).
-	 * @see #getTarget()
-	 */
-	public String getNext() {
-		return next;
-	}
-	
-	/**
-	 * Set the transition target by specifying its ID
-	 * 
-	 * @param next The the transition target ID (used by SCXML Digester only).
-	 * @see #setTarget(TransitionTarget)
-	 */
-	public void setNext(String next) {
-		this.next = next;
-	}
-	
-	/**
-	 * Supply this Transition object a handle to the notification
-	 * registry. Called by the Digester after instantiation.
-	 * 
-	 * @param reg The notification registry
-	 */
-	public void setNotificationRegistry(NotificationRegistry reg) {
-		notifReg = reg;
-	}
-	
-	/**
-	 * Get the notification registry.
-	 * 
-	 * @return The notification registry.
-	 */
-	public NotificationRegistry getNotificationRegistry() {
-		return notifReg;
-	}
-
-	/**
-	 * Get the path of this transiton.
-	 * 
-	 * @see Path
-	 * @return returns the transition path
-	 */
-	public Path getPath() {
-		if(path == null) {
-			path = new Path(getParent(), getTarget());
-		}
-		return path;
-	}
-	
+    /**
+     * Get the guard condition (may be null)
+     * 
+     * @return Returns the cond.
+     */
+    public String getCond() {
+        return cond;
+    }
+    
+    /**
+     * Set the guard condition
+     * 
+     * @param cond The cond to set.
+     */
+    public void setCond(String cond) {
+        this.cond = cond;
+    }
+    
+    /**
+     * Get the event that will trigger this transition (pending 
+     * evaluation of the guard condition in favor)
+     * 
+     * @return Returns the event.
+     */
+    public String getEvent() {
+        return event;
+    }
+    
+    /**
+     * Set the event that will trigger this transition (pending 
+     * evaluation of the guard condition in favor)
+     * 
+     * @param event The event to set.
+     */
+    public void setEvent(String event) {
+        this.event = event;
+    }
+    
+    /**
+     * Get the transition target (may be null)
+     * 
+     * @return Returns the target as specified in SCXML markup.
+     * <p>Remarks: Is <code>null</code> for &quot;stay&quot; transitions.
+     *  Returns parent (the source node) for &quot;self&quot; transitions.</p>
+     */
+    public TransitionTarget getTarget() {
+        return target;
+    }
+    
+    /**
+     * Get the runtime transition target, which always resolves to
+     * a TransitionTarget instance.
+     * 
+     * @return Returns the actual target of a transition at runtime.
+     * <p>Remarks: For both the &quot;stay&quot; and &quot;self&quot; 
+     * transitions it returns parent (the source node). This method should 
+     * never return <code>null</code>.</p>
+     */
+    public TransitionTarget getRuntimeTarget() {
+        return (target != null) ? target : parent;
+    }
+
+    
+    /**
+     * Set the transition target
+     * 
+     * @param target The target to set.
+     */
+    public void setTarget(TransitionTarget target) {
+        this.target = target;
+    }
+    
+    /**
+     * Get the ID of the transition target (may be null, if, for example,
+     * the target is specified inline)
+     * 
+     * @return Returns the transition target ID (used by SCXML Digester only).
+     * @see #getTarget()
+     */
+    public String getNext() {
+        return next;
+    }
+    
+    /**
+     * Set the transition target by specifying its ID
+     * 
+     * @param next The the transition target ID (used by SCXML Digester only).
+     * @see #setTarget(TransitionTarget)
+     */
+    public void setNext(String next) {
+        this.next = next;
+    }
+    
+    /**
+     * Supply this Transition object a handle to the notification
+     * registry. Called by the Digester after instantiation.
+     * 
+     * @param reg The notification registry
+     */
+    public void setNotificationRegistry(NotificationRegistry reg) {
+        notifReg = reg;
+    }
+    
+    /**
+     * Get the notification registry.
+     * 
+     * @return The notification registry.
+     */
+    public NotificationRegistry getNotificationRegistry() {
+        return notifReg;
+    }
+
+    /**
+     * Get the path of this transiton.
+     * 
+     * @see Path
+     * @return returns the transition path
+     */
+    public Path getPath() {
+        if(path == null) {
+            path = new Path(getParent(), getTarget());
+        }
+        return path;
+    }
+    
 }

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/TransitionTarget.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/TransitionTarget.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/TransitionTarget.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/TransitionTarget.java Wed Aug 10 14:10:59 2005
@@ -29,31 +29,31 @@
  * @author Jaroslav Gergic
  */
 public abstract class TransitionTarget implements Observable {
-	
+    
     /**
      * Identifier for this transition target. Other parts of the SCXML
      * document may refer to this &lt;state&gt; using this ID.
      */
-	private String id;
+    private String id;
 
     /**
      * Optional property holding executable content to be run upon
      * entering this transition target.
      */
-	private OnEntry onEntry;
+    private OnEntry onEntry;
 
     /**
      * Optional property holding executable content to be run upon
      * exiting this transition target.
      */
-	private OnExit onExit;
+    private OnExit onExit;
 
-	/**
+    /**
      * The parent of this transition target (may be null, if the parent
      * is the SCXML document root)
      */
     private TransitionTarget parent;
-	
+    
     /**
      * The notification registry
      */
@@ -63,11 +63,11 @@
      * Constructor
      */
     public TransitionTarget() {
-    	super();
-    	onEntry = new OnEntry(); //empty defaults
-    	onEntry.setParent(this);
-    	onExit = new OnExit();   //empty defaults
-    	onExit.setParent(this);
+        super();
+        onEntry = new OnEntry(); //empty defaults
+        onEntry.setParent(this);
+        onExit = new OnExit();   //empty defaults
+        onExit.setParent(this);
     }
 
     /**
@@ -85,117 +85,117 @@
      * @param lst The SCXMLListener to remove
      */
     public void removeListener(SCXMLListener lst) {
-    	notifReg.removeListener(this, lst);
+        notifReg.removeListener(this, lst);
+    }
+
+    /**
+     * Supply this TransitionTarget object a handle to the notification
+     * registry. Called by the Digester after instantiation.
+     * 
+     * @param reg The notification registry
+     */
+    public void setNotificationRegistry(NotificationRegistry reg) {
+        notifReg = reg;
+    }
+    
+    /**
+     * Get the notification registry.
+     * 
+     * @return The notification registry.
+     */
+    public NotificationRegistry getNotificationRegistry() {
+        return notifReg;
+    }
+    
+    /**
+     * Get the identifier for this transition target (may be null).
+     * 
+     * @return Returns the id.
+     */
+    public String getId() {
+        return id;
+    }
+    
+    /**
+     * Set the identifier for this transition target
+     * 
+     * @param id The id to set.
+     */
+    public void setId(String id) {
+        this.id = id;
+    }
+    
+    /**
+     * Get the onentry property.
+     * 
+     * @return Returns the onEntry.
+     */
+    public OnEntry getOnEntry() {
+        return onEntry;
+    }
+    
+    /**
+     * Set the onentry property.
+     * 
+     * @param onEntry The onEntry to set.
+     */
+    public void setOnEntry(OnEntry onentry) {
+        this.onEntry = onentry;
+    }
+    
+    /**
+     * Get the onexit property.
+     * 
+     * @return Returns the onExit.
+     */
+    public OnExit getOnExit() {
+        return onExit;
+    }
+    
+    /**
+     * Set the onexit property.
+     * 
+     * @param onExit The onExit to set.
+     */
+    public void setOnExit(OnExit onexit) {
+        this.onExit = onexit;
+    }
+    
+    /**
+     * Get the parent TransitionTarget
+     * 
+     * @return Returns the parent state 
+     * (null if parent is &lt;scxml&gt; element)
+     */
+    public TransitionTarget getParent() {
+        return parent;
+    }
+    
+    /**
+     * Set the parent TransitionTarget
+     * 
+     * @param parent The parent state to set
+     */
+    public void setParent(TransitionTarget parent) {
+        this.parent = parent;
     }
 
-	/**
-	 * Supply this TransitionTarget object a handle to the notification
-	 * registry. Called by the Digester after instantiation.
-	 * 
-	 * @param reg The notification registry
-	 */
-	public void setNotificationRegistry(NotificationRegistry reg) {
-		notifReg = reg;
-	}
-	
-	/**
-	 * Get the notification registry.
-	 * 
-	 * @return The notification registry.
-	 */
-	public NotificationRegistry getNotificationRegistry() {
-		return notifReg;
-	}
-	
-	/**
-	 * Get the identifier for this transition target (may be null).
-	 * 
-	 * @return Returns the id.
-	 */
-	public String getId() {
-		return id;
-	}
-	
-	/**
-	 * Set the identifier for this transition target
-	 * 
-	 * @param id The id to set.
-	 */
-	public void setId(String id) {
-		this.id = id;
-	}
-	
-	/**
-	 * Get the onentry property.
-	 * 
-	 * @return Returns the onEntry.
-	 */
-	public OnEntry getOnEntry() {
-		return onEntry;
-	}
-	
-	/**
-	 * Set the onentry property.
-	 * 
-	 * @param onEntry The onEntry to set.
-	 */
-	public void setOnEntry(OnEntry onentry) {
-		this.onEntry = onentry;
-	}
-	
-	/**
-	 * Get the onexit property.
-	 * 
-	 * @return Returns the onExit.
-	 */
-	public OnExit getOnExit() {
-		return onExit;
-	}
-	
-	/**
-	 * Set the onexit property.
-	 * 
-	 * @param onExit The onExit to set.
-	 */
-	public void setOnExit(OnExit onexit) {
-		this.onExit = onexit;
-	}
-	
-	/**
-	 * Get the parent TransitionTarget
-	 * 
-	 * @return Returns the parent state 
-	 * (null if parent is &lt;scxml&gt; element)
-	 */
-	public TransitionTarget getParent() {
-		return parent;
-	}
-	
-	/**
-	 * Set the parent TransitionTarget
-	 * 
-	 * @param parent The parent state to set
-	 */
-	public void setParent(TransitionTarget parent) {
-		this.parent = parent;
-	}
-
-	/**
-	 * Get the parent State
-	 * 
-	 * @return The parent State
-	 */
-	public State getParentState() {
-		TransitionTarget tt = this.getParent();
-		if (tt == null) {
-			return null;
-		} else {
-			if (tt instanceof State) {
-				return (State) tt;
-			} else { //tt is Parallel
-				return tt.getParentState();
-			}
-		}
-	}
-	
+    /**
+     * Get the parent State
+     * 
+     * @return The parent State
+     */
+    public State getParentState() {
+        TransitionTarget tt = this.getParent();
+        if (tt == null) {
+            return null;
+        } else {
+            if (tt instanceof State) {
+                return (State) tt;
+            } else { //tt is Parallel
+                return tt.getParentState();
+            }
+        }
+    }
+    
 }

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Var.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Var.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Var.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Var.java Wed Aug 10 14:10:59 2005
@@ -25,60 +25,60 @@
  * @author Jaroslav Gergic
  */
 public class Var extends Action {
-	
+    
     /**
      * The name of the variable to be created
      */
-	private String name;
+    private String name;
 
     /**
      * The expression that evaluates to the initial value of the variable
      */
-	private String expr;
-	
-	/**
-	 * Constructor
-	 */
-	public Var() {
-		super();
-	}
-	
-	/**
-	 * Get the expression that evaluates to the initial value 
-	 * of the variable
-	 * 
-	 * @return Returns the expr.
-	 */
-	public String getExpr() {
-		return expr;
-	}
-	
-	/**
-	 * Set the expression that evaluates to the initial value 
-	 * of the variable
-	 * 
-	 * @param expr The expr to set.
-	 */
-	public void setExpr(String expr) {
-		this.expr = expr;
-	}
-	
-	/**
-	 * Get the name of the (new) variable.
-	 * 
-	 * @return Returns the name.
-	 */
-	public String getName() {
-		return name;
-	}
-	
-	/**
-	 * Set the name of the (new) variable.
-	 * 
-	 * @param name The name to set.
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-	
+    private String expr;
+    
+    /**
+     * Constructor
+     */
+    public Var() {
+        super();
+    }
+    
+    /**
+     * Get the expression that evaluates to the initial value 
+     * of the variable
+     * 
+     * @return Returns the expr.
+     */
+    public String getExpr() {
+        return expr;
+    }
+    
+    /**
+     * Set the expression that evaluates to the initial value 
+     * of the variable
+     * 
+     * @param expr The expr to set.
+     */
+    public void setExpr(String expr) {
+        this.expr = expr;
+    }
+    
+    /**
+     * Get the name of the (new) variable.
+     * 
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    
+    /**
+     * Set the name of the (new) variable.
+     * 
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org