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 [12/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/env/ELContext.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELContext.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELContext.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELContext.java Wed Aug 10 14:10:59 2005
@@ -34,124 +34,124 @@
* @author Rahul Akolkar
*/
public class ELContext implements Context , VariableResolver {
-
- //let's make the log category implementation independent
- protected static Log log = LogFactory.getLog(Context.class);
-
- protected Context parent = null;
- protected HashMap vars = new HashMap();
-
- /**
- * Constructor
- *
- */
- public ELContext() {
- this(null);
- }
-
- /**
- * @param parent a parent ELContext, can be null
- */
- public ELContext(Context parent) {
- this.parent = parent;
- }
+
+ //let's make the log category implementation independent
+ protected static Log log = LogFactory.getLog(Context.class);
+
+ protected Context parent = null;
+ protected HashMap vars = new HashMap();
+
+ /**
+ * Constructor
+ *
+ */
+ public ELContext() {
+ this(null);
+ }
+
+ /**
+ * @param parent a parent ELContext, can be null
+ */
+ public ELContext(Context parent) {
+ this.parent = parent;
+ }
- /**
- * Assigns a new value to an existing variable or creates a new one.
+ /**
+ * Assigns a new value to an existing variable or creates a new one.
* The method searches the chain of parent Contexts for variable
* existence.
- *
- * @see org.apache.taglibs.rdc.scxml.Context#set(java.lang.String, java.lang.Object)
- */
- public void set(String name, Object value) {
- if(vars.containsKey(name)) { //first try to override local
- setLocal(name, value);
- } else if(parent != null && parent.has(name)) { //then check for global
- parent.set(name, value);
- } else { //otherwise create a new local variable
- setLocal(name, value);
- }
- }
-
- /**
- * Get the value of this variable; delegating to parent
- *
- * @see org.apache.taglibs.rdc.scxml.Context#get(java.lang.String)
- */
- public Object get(String name) {
- if(vars.containsKey(name)) {
- return vars.get(name);
- } else if(parent != null) {
- return parent.get(name);
- } else {
- return null;
- }
- }
-
- /**
- * Check if this variable exists, delegating to parent
- *
- * @see org.apache.taglibs.rdc.scxml.Context#has(java.lang.String)
- */
- public boolean has(String name) {
- if(vars.containsKey(name)) {
- return true;
- } else if(parent != null && parent.has(name)) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Get an Iterator over all variables in this Context
- *
- * @see org.apache.taglibs.rdc.scxml.Context#iterator()
- */
- public Iterator iterator() {
- return vars.entrySet().iterator();
- }
-
- /**
- * Clear this Context
- *
- * @see org.apache.taglibs.rdc.scxml.Context#reset()
- */
- public void reset() {
- vars.clear();
- }
-
- /**
- * Get the parent Context, may be null
- *
- * @see org.apache.taglibs.rdc.scxml.Context#getParent()
- */
- public Context getParent() {
- return parent;
- }
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#set(java.lang.String, java.lang.Object)
+ */
+ public void set(String name, Object value) {
+ if(vars.containsKey(name)) { //first try to override local
+ setLocal(name, value);
+ } else if(parent != null && parent.has(name)) { //then check for global
+ parent.set(name, value);
+ } else { //otherwise create a new local variable
+ setLocal(name, value);
+ }
+ }
+
+ /**
+ * Get the value of this variable; delegating to parent
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#get(java.lang.String)
+ */
+ public Object get(String name) {
+ if(vars.containsKey(name)) {
+ return vars.get(name);
+ } else if(parent != null) {
+ return parent.get(name);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Check if this variable exists, delegating to parent
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#has(java.lang.String)
+ */
+ public boolean has(String name) {
+ if(vars.containsKey(name)) {
+ return true;
+ } else if(parent != null && parent.has(name)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Get an Iterator over all variables in this Context
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#iterator()
+ */
+ public Iterator iterator() {
+ return vars.entrySet().iterator();
+ }
+
+ /**
+ * Clear this Context
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#reset()
+ */
+ public void reset() {
+ vars.clear();
+ }
+
+ /**
+ * Get the parent Context, may be null
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#getParent()
+ */
+ public Context getParent() {
+ return parent;
+ }
- /**
- * Assigns a new value to an existing variable or creates a new one.
+ /**
+ * Assigns a new value to an existing variable or creates a new one.
* The method allows to shaddow a variable of the same name up the
* Context chain.
- *
- * @see org.apache.taglibs.rdc.scxml.Context#setLocal(java.lang.String, java.lang.Object)
- */
- public void setLocal(String name, Object value) {
- vars.put(name, value);
- if(log.isDebugEnabled() && !name.equals("_ALL_STATES")) {
- log.debug(name + " = " + String.valueOf(value));
- }
- }
-
- /**
- * Resolves the specified variable. Returns null if the variable is
- * not found.
- *
- * @see javax.servlet.jsp.el.VariableResolver#resolveVariable(java.lang.String)
- */
- public Object resolveVariable(String pName) throws ELException {
- return get(pName);
- }
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#setLocal(java.lang.String, java.lang.Object)
+ */
+ public void setLocal(String name, Object value) {
+ vars.put(name, value);
+ if(log.isDebugEnabled() && !name.equals("_ALL_STATES")) {
+ log.debug(name + " = " + String.valueOf(value));
+ }
+ }
+
+ /**
+ * Resolves the specified variable. Returns null if the variable is
+ * not found.
+ *
+ * @see javax.servlet.jsp.el.VariableResolver#resolveVariable(java.lang.String)
+ */
+ public Object resolveVariable(String pName) throws ELException {
+ return get(pName);
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELEvaluator.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELEvaluator.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELEvaluator.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ELEvaluator.java Wed Aug 10 14:10:59 2005
@@ -42,148 +42,148 @@
*/
public class ELEvaluator implements Evaluator {
- //let's make the log category implementation independent
- private static Log log = LogFactory.getLog(Evaluator.class);
- private FunctionMapper fm = new FunctWrapper();
- private static Pattern inFct = Pattern.compile("In\\(");
-
- ExpressionEvaluator ee = null;
-
- /**
- * Constructor
- */
- public ELEvaluator() {
- ee = new ExpressionEvaluatorImpl();
- }
+ //let's make the log category implementation independent
+ private static Log log = LogFactory.getLog(Evaluator.class);
+ private FunctionMapper fm = new FunctWrapper();
+ private static Pattern inFct = Pattern.compile("In\\(");
+
+ ExpressionEvaluator ee = null;
+
+ /**
+ * Constructor
+ */
+ public ELEvaluator() {
+ ee = new ExpressionEvaluatorImpl();
+ }
- /**
- * Evaluate an expression
+ /**
+ * Evaluate an expression
*
* @param ctx variable context
* @param expr expression
* @return a result of the evaluation
* @throws SCXMLExpressionException
- * @see org.apache.taglibs.rdc.scxml.Evaluator#eval(org.apache.taglibs.rdc.scxml.Context, java.lang.String)
- */
- public Object eval(Context ctx, String expr)
- throws SCXMLExpressionException {
- VariableResolver vr = null;
- if(ctx instanceof VariableResolver) {
- vr = (VariableResolver)ctx;
- } else {
- vr = new CtxWrapper(ctx);
- }
- try {
- expr = inFct.matcher(expr).replaceAll("In(_ALL_STATES, ");
- Object rslt = ee.evaluate(expr, Object.class, vr, fm);
- if(log.isTraceEnabled()) {
- log.trace(expr + " = " + String.valueOf(rslt));
- }
- return rslt;
- } catch (ELException e) {
- throw new SCXMLExpressionException(e);
- }
- }
+ * @see org.apache.taglibs.rdc.scxml.Evaluator#eval(org.apache.taglibs.rdc.scxml.Context, java.lang.String)
+ */
+ public Object eval(Context ctx, String expr)
+ throws SCXMLExpressionException {
+ VariableResolver vr = null;
+ if(ctx instanceof VariableResolver) {
+ vr = (VariableResolver)ctx;
+ } else {
+ vr = new CtxWrapper(ctx);
+ }
+ try {
+ expr = inFct.matcher(expr).replaceAll("In(_ALL_STATES, ");
+ Object rslt = ee.evaluate(expr, Object.class, vr, fm);
+ if(log.isTraceEnabled()) {
+ log.trace(expr + " = " + String.valueOf(rslt));
+ }
+ return rslt;
+ } catch (ELException e) {
+ throw new SCXMLExpressionException(e);
+ }
+ }
- /**
- * Create a new child context.
+ /**
+ * Create a new child context.
*
* @param parent parent context
* @return new child context
- * @see org.apache.taglibs.rdc.scxml.Evaluator#newContext(org.apache.taglibs.rdc.scxml.Context)
- */
- public Context newContext(Context parent) {
- //for now, we do not support nested variable contexts
- //world is flat ;)
- if(parent != null) {
- return parent;
- } else {
- return new ELContext(null);
- }
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.Evaluator#evalCond(org.apache.taglibs.rdc.scxml.Context, java.lang.String)
- */
- public Boolean evalCond(Context ctx, String expr)
- throws SCXMLExpressionException {
- VariableResolver vr = null;
- if(ctx instanceof VariableResolver) {
- vr = (VariableResolver)ctx;
- } else {
- vr = new CtxWrapper(ctx);
- }
- try {
- expr = inFct.matcher(expr).replaceAll("In(_ALL_STATES, ");
- Boolean rslt = (Boolean) ee.evaluate(expr, Boolean.class, vr, fm);
- if(log.isDebugEnabled()) {
- log.debug(expr + " = " + String.valueOf(rslt));
- }
- return rslt;
- } catch (ELException e) {
- throw new SCXMLExpressionException(e);
- }
- }
-
- /**
- * A Context wrapper that implements VariableResolver
- */
- class CtxWrapper implements VariableResolver {
- Context ctx = null;
- CtxWrapper(Context ctx) {
- this.ctx = ctx;
- }
- public Object resolveVariable(String pName) throws ELException {
- Object rslt = ctx.get(pName);
- if(rslt == null) {
- throw new ELException("Variable " + pName + "does not exist!");
- }
- return rslt;
- }
- }
-
- /**
- * A simple function mapper for SCXML defined functions
- */
- class FunctWrapper implements FunctionMapper {
-
- /**
- * @see javax.servlet.jsp.el.FunctionMapper#resolveFunction(java.lang.String, java.lang.String)
- */
- public Method resolveFunction(String prefix, String localName) {
- if(localName.equals("In")) {
- Class attrs[] = new Class[2];
- attrs[0] = Set.class;
- attrs[1] = String.class;
- try {
- return ELEvaluator.class.getMethod("isMember", attrs);
- } catch (SecurityException e) {
- log.error("resolving isMember(Set, String)", e);
- } catch (NoSuchMethodException e) {
- log.error("resolving isMember(Set, String)", e);
- }
- }
- return null;
- }
- }
-
- /**
- * Does this state belong to the Set of these States.
- * Simple ID based comparator
- *
- * @param allStates The Set of State objects to look in
- * @param state The State to compare with
- * @return Whether this State belongs to this Set
- */
- public static final boolean isMember(Set allStates, String state) {
- Iterator i = allStates.iterator();
- while(i.hasNext()) {
- TransitionTarget tt = (TransitionTarget)i.next();
- if(state.equals(tt.getId())) {
- return true;
- }
- }
- return false;
- }
+ * @see org.apache.taglibs.rdc.scxml.Evaluator#newContext(org.apache.taglibs.rdc.scxml.Context)
+ */
+ public Context newContext(Context parent) {
+ //for now, we do not support nested variable contexts
+ //world is flat ;)
+ if(parent != null) {
+ return parent;
+ } else {
+ return new ELContext(null);
+ }
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.Evaluator#evalCond(org.apache.taglibs.rdc.scxml.Context, java.lang.String)
+ */
+ public Boolean evalCond(Context ctx, String expr)
+ throws SCXMLExpressionException {
+ VariableResolver vr = null;
+ if(ctx instanceof VariableResolver) {
+ vr = (VariableResolver)ctx;
+ } else {
+ vr = new CtxWrapper(ctx);
+ }
+ try {
+ expr = inFct.matcher(expr).replaceAll("In(_ALL_STATES, ");
+ Boolean rslt = (Boolean) ee.evaluate(expr, Boolean.class, vr, fm);
+ if(log.isDebugEnabled()) {
+ log.debug(expr + " = " + String.valueOf(rslt));
+ }
+ return rslt;
+ } catch (ELException e) {
+ throw new SCXMLExpressionException(e);
+ }
+ }
+
+ /**
+ * A Context wrapper that implements VariableResolver
+ */
+ class CtxWrapper implements VariableResolver {
+ Context ctx = null;
+ CtxWrapper(Context ctx) {
+ this.ctx = ctx;
+ }
+ public Object resolveVariable(String pName) throws ELException {
+ Object rslt = ctx.get(pName);
+ if(rslt == null) {
+ throw new ELException("Variable " + pName + "does not exist!");
+ }
+ return rslt;
+ }
+ }
+
+ /**
+ * A simple function mapper for SCXML defined functions
+ */
+ class FunctWrapper implements FunctionMapper {
+
+ /**
+ * @see javax.servlet.jsp.el.FunctionMapper#resolveFunction(java.lang.String, java.lang.String)
+ */
+ public Method resolveFunction(String prefix, String localName) {
+ if(localName.equals("In")) {
+ Class attrs[] = new Class[2];
+ attrs[0] = Set.class;
+ attrs[1] = String.class;
+ try {
+ return ELEvaluator.class.getMethod("isMember", attrs);
+ } catch (SecurityException e) {
+ log.error("resolving isMember(Set, String)", e);
+ } catch (NoSuchMethodException e) {
+ log.error("resolving isMember(Set, String)", e);
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Does this state belong to the Set of these States.
+ * Simple ID based comparator
+ *
+ * @param allStates The Set of State objects to look in
+ * @param state The State to compare with
+ * @return Whether this State belongs to this Set
+ */
+ public static final boolean isMember(Set allStates, String state) {
+ Iterator i = allStates.iterator();
+ while(i.hasNext()) {
+ TransitionTarget tt = (TransitionTarget)i.next();
+ if(state.equals(tt.getId())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/RootContext.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/RootContext.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/RootContext.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/RootContext.java Wed Aug 10 14:10:59 2005
@@ -30,49 +30,49 @@
* @author Rahul Akolkar
*/
public final class RootContext extends ELContext {
-
- private VariableResolver vr;
- /**
- * Constructor
- *
- * @param ctx the host JspContext
- */
- public RootContext(JspContext ctx) {
- super();
- if (ctx == null) {
- log.error("Host JSP Context cannot be null");
- }
- // only retain the VariableResolver
- this.vr = ctx.getVariableResolver();
- }
+
+ private VariableResolver vr;
+ /**
+ * Constructor
+ *
+ * @param ctx the host JspContext
+ */
+ public RootContext(JspContext ctx) {
+ super();
+ if (ctx == null) {
+ log.error("Host JSP Context cannot be null");
+ }
+ // only retain the VariableResolver
+ this.vr = ctx.getVariableResolver();
+ }
- /**
- * Get the value of the given variable in this Context
- *
- * @return The value (or null)
- * @see org.apache.taglibs.rdc.scxml.Context#get(java.lang.String)
- */
- public Object get(String name) {
- Object value = super.get(name);
- if (value == null) {
- try {
- value = vr.resolveVariable(name);
- } catch (ELException ele) {
- log.error(ele.getMessage(), ele);
- }
- }
- return value;
- }
+ /**
+ * Get the value of the given variable in this Context
+ *
+ * @return The value (or null)
+ * @see org.apache.taglibs.rdc.scxml.Context#get(java.lang.String)
+ */
+ public Object get(String name) {
+ Object value = super.get(name);
+ if (value == null) {
+ try {
+ value = vr.resolveVariable(name);
+ } catch (ELException ele) {
+ log.error(ele.getMessage(), ele);
+ }
+ }
+ return value;
+ }
- /**
- * Get the Iterator
- *
- * @see org.apache.taglibs.rdc.scxml.Context#iterator()
- */
- public Iterator iterator() {
- // The reason why this method body exists is to emphasize that
- // read-only (JSP) variables are not included in the Iterator
- return super.iterator();
- }
+ /**
+ * Get the Iterator
+ *
+ * @see org.apache.taglibs.rdc.scxml.Context#iterator()
+ */
+ public Iterator iterator() {
+ // The reason why this method body exists is to emphasize that
+ // read-only (JSP) variables are not included in the Iterator
+ return super.iterator();
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ServletContextResolver.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ServletContextResolver.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ServletContextResolver.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/ServletContextResolver.java Wed Aug 10 14:10:59 2005
@@ -28,36 +28,36 @@
* @author Jaroslav Gergic
*/
public class ServletContextResolver implements PathResolver {
-
- ServletContext ctx = null;
+
+ ServletContext ctx = null;
- /**
- * @param ctx The ServletContext instance for this RDC runtime.
- */
- public ServletContextResolver(ServletContext ctx) {
- this.ctx = ctx;
- }
-
- /**
- * Delegates to the underlying ServletContext.getRealPath(String)
- *
- * @param ctxPath context sensitive path, can be a relative URL
- * @return resolved path (an absolute URL) or <code>null</code>
- * @see org.apache.taglibs.rdc.scxml.PathResolver#resolvePath(java.lang.String)
- */
- public String resolvePath(String ctxPath) {
- return ctx.getRealPath(ctxPath);
- }
+ /**
+ * @param ctx The ServletContext instance for this RDC runtime.
+ */
+ public ServletContextResolver(ServletContext ctx) {
+ this.ctx = ctx;
+ }
+
+ /**
+ * Delegates to the underlying ServletContext.getRealPath(String)
+ *
+ * @param ctxPath context sensitive path, can be a relative URL
+ * @return resolved path (an absolute URL) or <code>null</code>
+ * @see org.apache.taglibs.rdc.scxml.PathResolver#resolvePath(java.lang.String)
+ */
+ public String resolvePath(String ctxPath) {
+ return ctx.getRealPath(ctxPath);
+ }
- /**
- * Retrieve the PathResolver rooted at the given path.
- *
- * @param ctxPath context sensitive path, can be a relative URL
- * @return returns a new resolver rooted at ctxPath
- * @see org.apache.taglibs.rdc.scxml.PathResolver#getResolver(java.lang.String)
- */
- public PathResolver getResolver(String ctxPath) {
- return this;
- }
+ /**
+ * Retrieve the PathResolver rooted at the given path.
+ *
+ * @param ctxPath context sensitive path, can be a relative URL
+ * @return returns a new resolver rooted at ctxPath
+ * @see org.apache.taglibs.rdc.scxml.PathResolver#getResolver(java.lang.String)
+ */
+ public PathResolver getResolver(String ctxPath) {
+ return this;
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/SimpleDispatcher.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/SimpleDispatcher.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/SimpleDispatcher.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/SimpleDispatcher.java Wed Aug 10 14:10:59 2005
@@ -29,42 +29,42 @@
* @author Jaroslav Gergic
*/
public class SimpleDispatcher implements EventDispatcher {
-
- private static Log log = LogFactory.getLog(EventDispatcher.class);
+
+ private static Log log = LogFactory.getLog(EventDispatcher.class);
- /**
- * Constructor
- */
- public SimpleDispatcher() {
- }
+ /**
+ * Constructor
+ */
+ public SimpleDispatcher() {
+ }
- /**
- * @see org.apache.taglibs.rdc.scxml.EventDispatcher#cancel(java.lang.String)
- */
- public void cancel(String sendId) {
- if(log.isInfoEnabled()) {
- log.info("cancel( sendId: " + sendId + ")");
- }
- }
+ /**
+ * @see org.apache.taglibs.rdc.scxml.EventDispatcher#cancel(java.lang.String)
+ */
+ public void cancel(String sendId) {
+ if(log.isInfoEnabled()) {
+ log.info("cancel( sendId: " + sendId + ")");
+ }
+ }
- /**
- * @see org.apache.taglibs.rdc.scxml.EventDispatcher#send(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.Object, long)
- */
- public void send(String sendId, String target, String targetType,
- String event, Map params, Object hints, long delay) {
- if(log.isInfoEnabled()) {
- StringBuffer buf = new StringBuffer(32);
- buf.append("send ( sendId: ").append(sendId);
- buf.append(", target: ").append(target);
- buf.append(", targetType: ").append(targetType);
- buf.append(", event: ").append(event);
- buf.append(", params: ").append(String.valueOf(params.toString()));
- buf.append(", hints: ").append(String.valueOf(hints.toString()));
- buf.append(", delay: ").append(delay);
- buf.append(')');
- log.info(buf.toString());
- }
+ /**
+ * @see org.apache.taglibs.rdc.scxml.EventDispatcher#send(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.Object, long)
+ */
+ public void send(String sendId, String target, String targetType,
+ String event, Map params, Object hints, long delay) {
+ if(log.isInfoEnabled()) {
+ StringBuffer buf = new StringBuffer(32);
+ buf.append("send ( sendId: ").append(sendId);
+ buf.append(", target: ").append(target);
+ buf.append(", targetType: ").append(targetType);
+ buf.append(", event: ").append(event);
+ buf.append(", params: ").append(String.valueOf(params.toString()));
+ buf.append(", hints: ").append(String.valueOf(hints.toString()));
+ buf.append(", delay: ").append(delay);
+ buf.append(')');
+ log.info(buf.toString());
+ }
- }
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Standalone.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Standalone.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Standalone.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Standalone.java Wed Aug 10 14:10:59 2005
@@ -41,81 +41,81 @@
*/
public class Standalone {
- /**
- * Launcher
- */
- public static void main(String[] args) {
- if (args.length != 1) {
- System.out.println("USAGE: java " + Standalone.class.getName()
- + "<url|filename>");
- System.exit(-1);
- }
- try {
- String uri = getCanonicalURI(args[0]);
- Evaluator engine = new ELEvaluator();
- Context rootCtx = engine.newContext(null);
- EventDispatcher ed = new SimpleDispatcher();
- Tracer trc = new Tracer();
- SCXML doc = SCXMLDigester.digest(new URL(uri), trc, rootCtx, engine);
- if(doc == null) {
- System.err.println("The SCXML document " + uri
- + " can not be parsed!");
- System.exit(-1);
- }
- System.err.println(SCXMLDigester.serializeSCXML(doc));
- SCXMLExecutor exec = new SCXMLExecutor(engine, ed, trc);
- doc.addListener(trc);
- exec.setSuperStep(true);
- exec.setStateMachine(doc);
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String event = null;
- while((event = br.readLine()) != null) {
- event = event.trim();
- if(event.equals("help") || event.equals("?")) {
- System.out.println("enter a space-separated list of events");
- System.out.println("to quit, enter \"quit\"");
- System.out.println("to reset state machine, enter \"reset\"");
- } else if(event.equals("quit")) {
- break;
- } else if(event.equals("reset")) {
- exec.reset();
- } else {
- StringTokenizer st = new StringTokenizer(event);
- int tkns = st.countTokens();
- TriggerEvent evts[] = new TriggerEvent[tkns];
- for(int i=0; i<tkns; i++) {
- evts[i] = new TriggerEvent(st.nextToken(),
- TriggerEvent.SIGNAL_EVENT, null);
- }
- exec.triggerEvents(evts);
- if(exec.getCurrentStatus().isFinal()) {
- System.out.println("A final configuration reached.");
- }
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } catch (ModelException e){
- e.printStackTrace();
- }
-
- }
-
- /**
- * @param uri an absolute or relative URL
- * @return java.lang.String canonical URL (absolute)
- * @throws java.io.IOException if a relative URL can not be resolved
- * to a local file
- * @author Lubos Ures
- */
- private static String getCanonicalURI(String uri) throws IOException {
- if (uri.toLowerCase().startsWith("http://")
- || uri.toLowerCase().startsWith("file://")) {
- } else {
- File in = new File(uri);
- uri = "file:///" + in.getCanonicalPath();
- }
- return uri;
- }
-
+ /**
+ * Launcher
+ */
+ public static void main(String[] args) {
+ if (args.length != 1) {
+ System.out.println("USAGE: java " + Standalone.class.getName()
+ + "<url|filename>");
+ System.exit(-1);
+ }
+ try {
+ String uri = getCanonicalURI(args[0]);
+ Evaluator engine = new ELEvaluator();
+ Context rootCtx = engine.newContext(null);
+ EventDispatcher ed = new SimpleDispatcher();
+ Tracer trc = new Tracer();
+ SCXML doc = SCXMLDigester.digest(new URL(uri), trc, rootCtx, engine);
+ if(doc == null) {
+ System.err.println("The SCXML document " + uri
+ + " can not be parsed!");
+ System.exit(-1);
+ }
+ System.err.println(SCXMLDigester.serializeSCXML(doc));
+ SCXMLExecutor exec = new SCXMLExecutor(engine, ed, trc);
+ doc.addListener(trc);
+ exec.setSuperStep(true);
+ exec.setStateMachine(doc);
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
+ String event = null;
+ while((event = br.readLine()) != null) {
+ event = event.trim();
+ if(event.equals("help") || event.equals("?")) {
+ System.out.println("enter a space-separated list of events");
+ System.out.println("to quit, enter \"quit\"");
+ System.out.println("to reset state machine, enter \"reset\"");
+ } else if(event.equals("quit")) {
+ break;
+ } else if(event.equals("reset")) {
+ exec.reset();
+ } else {
+ StringTokenizer st = new StringTokenizer(event);
+ int tkns = st.countTokens();
+ TriggerEvent evts[] = new TriggerEvent[tkns];
+ for(int i=0; i<tkns; i++) {
+ evts[i] = new TriggerEvent(st.nextToken(),
+ TriggerEvent.SIGNAL_EVENT, null);
+ }
+ exec.triggerEvents(evts);
+ if(exec.getCurrentStatus().isFinal()) {
+ System.out.println("A final configuration reached.");
+ }
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (ModelException e){
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @param uri an absolute or relative URL
+ * @return java.lang.String canonical URL (absolute)
+ * @throws java.io.IOException if a relative URL can not be resolved
+ * to a local file
+ * @author Lubos Ures
+ */
+ private static String getCanonicalURI(String uri) throws IOException {
+ if (uri.toLowerCase().startsWith("http://")
+ || uri.toLowerCase().startsWith("file://")) {
+ } else {
+ File in = new File(uri);
+ uri = "file:///" + in.getCanonicalPath();
+ }
+ return uri;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Tracer.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Tracer.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Tracer.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/Tracer.java Wed Aug 10 14:10:59 2005
@@ -41,153 +41,153 @@
*/
public class Tracer implements ErrorReporter, SCXMLListener, ErrorHandler {
- private static Log log = LogFactory.getLog(Tracer.class);
-
- /**
- * Constructor
- */
- public Tracer() {
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.ErrorReporter#onError(java.lang.String, java.lang.String, java.lang.Object)
- */
- public void onError(String errCode, String errDetail, Object errCtx) {
- //Note: the if-then-else below is based on the actual usage
- // (codebase search), it has to be kept up-to-date as the code changes
- errCode = errCode.intern();
- StringBuffer msg = new StringBuffer();
- msg.append(errCode).append(" (");
- msg.append(errDetail).append("): ");
- if (errCode == ErrorReporter.NO_INITIAL) {
- if (errCtx instanceof SCXML) {
- //determineInitialStates
- msg.append("<SCXML>");
- } else if (errCtx instanceof State) {
- //determineInitialStates
- //determineTargetStates
- msg.append("State " + Tracer.getTTPath((State)errCtx));
- }
- } else if (errCode == ErrorReporter.UNKNOWN_ACTION) {
- //executeActionList
- msg.append("Action: " + errCtx.getClass().getName());
- } else if (errCode == ErrorReporter.NON_DETERMINISTIC) {
- //filterTransitionSet
- msg.append(" [");
- if(errCtx instanceof HashSet) {
- Iterator i = ((HashSet)errCtx).iterator();
- while(i.hasNext()) {
- Transition t = (Transition)i.next();
- msg.append(transToString(t.getParent(), t.getTarget(), t));
- if(i.hasNext()) {
- msg.append(", ");
- }
- }
- }
- msg.append(']');
- } else if (errCode == ErrorReporter.ILLEGAL_CONFIG) {
- //isLegalConfig
- if (errCtx instanceof Map.Entry) {
- TransitionTarget tt = (TransitionTarget)(((Map.Entry)errCtx).getKey());
- HashSet vals = (HashSet)(((Map.Entry)errCtx).getValue());
- msg.append(Tracer.getTTPath(tt) + " : [");
- Iterator i = vals.iterator();
- while(i.hasNext()) {
- TransitionTarget tx = (TransitionTarget)i.next();
- msg.append(Tracer.getTTPath(tx));
- if(i.hasNext()) {
- msg.append(", ");
- }
- }
- msg.append(']');
- } else if (errCtx instanceof HashSet) {
- HashSet vals = (HashSet)(errCtx);
- msg.append("<SCXML> : [");
- Iterator i = vals.iterator();
- while(i.hasNext()) {
- TransitionTarget tx = (TransitionTarget)i.next();
- msg.append(Tracer.getTTPath(tx));
- if(i.hasNext()) {
- msg.append(", ");
- }
- }
- msg.append(']');
- }
- }
- log.warn(msg.toString());
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onEntry(org.apache.taglibs.rdc.scxml.model.TransitionTarget)
- */
- public void onEntry(TransitionTarget state) {
- log.info(Tracer.getTTPath(state));
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onExit(org.apache.taglibs.rdc.scxml.model.TransitionTarget)
- */
- public void onExit(TransitionTarget state) {
- log.info(Tracer.getTTPath(state));
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onTransition(org.apache.taglibs.rdc.scxml.model.TransitionTarget, org.apache.taglibs.rdc.scxml.model.TransitionTarget, org.apache.taglibs.rdc.scxml.model.Transition)
- */
- public void onTransition(TransitionTarget from, TransitionTarget to,
- Transition transition) {
- log.info(transToString(from, to, transition));
- }
-
- private static final String transToString(TransitionTarget from,
- TransitionTarget to, Transition transition) {
- StringBuffer buf = new StringBuffer("transition (");
- buf.append("event = ").append(transition.getEvent());
- buf.append(", cond = ").append(transition.getCond());
- buf.append(", from = ").append(Tracer.getTTPath(from));
- buf.append(", to = ").append(Tracer.getTTPath(to));
- buf.append(')');
- return buf.toString();
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException exception) throws SAXException {
- log.warn(exception.getMessage(), exception);
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException exception) throws SAXException {
- log.error(exception.getMessage(), exception);
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException exception) throws SAXException {
- log.fatal(exception.getMessage(), exception);
- }
-
- private static final String getTTPath(TransitionTarget tt) {
- if(tt.getParent() == null) {
- return "/" + tt.getId();
- } else {
- LinkedList ll = new LinkedList();
- while(tt != null) {
- ll.addFirst(tt);
- tt = tt.getParent();
- }
- Iterator i = ll.iterator();
- StringBuffer names = new StringBuffer();
- while(i.hasNext()) {
- TransitionTarget tmp = (TransitionTarget)i.next();
- names.append('/').append(tmp.getId());
- }
- return names.toString();
- }
- }
+ private static Log log = LogFactory.getLog(Tracer.class);
+
+ /**
+ * Constructor
+ */
+ public Tracer() {
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.ErrorReporter#onError(java.lang.String, java.lang.String, java.lang.Object)
+ */
+ public void onError(String errCode, String errDetail, Object errCtx) {
+ //Note: the if-then-else below is based on the actual usage
+ // (codebase search), it has to be kept up-to-date as the code changes
+ errCode = errCode.intern();
+ StringBuffer msg = new StringBuffer();
+ msg.append(errCode).append(" (");
+ msg.append(errDetail).append("): ");
+ if (errCode == ErrorReporter.NO_INITIAL) {
+ if (errCtx instanceof SCXML) {
+ //determineInitialStates
+ msg.append("<SCXML>");
+ } else if (errCtx instanceof State) {
+ //determineInitialStates
+ //determineTargetStates
+ msg.append("State " + Tracer.getTTPath((State)errCtx));
+ }
+ } else if (errCode == ErrorReporter.UNKNOWN_ACTION) {
+ //executeActionList
+ msg.append("Action: " + errCtx.getClass().getName());
+ } else if (errCode == ErrorReporter.NON_DETERMINISTIC) {
+ //filterTransitionSet
+ msg.append(" [");
+ if(errCtx instanceof HashSet) {
+ Iterator i = ((HashSet)errCtx).iterator();
+ while(i.hasNext()) {
+ Transition t = (Transition)i.next();
+ msg.append(transToString(t.getParent(), t.getTarget(), t));
+ if(i.hasNext()) {
+ msg.append(", ");
+ }
+ }
+ }
+ msg.append(']');
+ } else if (errCode == ErrorReporter.ILLEGAL_CONFIG) {
+ //isLegalConfig
+ if (errCtx instanceof Map.Entry) {
+ TransitionTarget tt = (TransitionTarget)(((Map.Entry)errCtx).getKey());
+ HashSet vals = (HashSet)(((Map.Entry)errCtx).getValue());
+ msg.append(Tracer.getTTPath(tt) + " : [");
+ Iterator i = vals.iterator();
+ while(i.hasNext()) {
+ TransitionTarget tx = (TransitionTarget)i.next();
+ msg.append(Tracer.getTTPath(tx));
+ if(i.hasNext()) {
+ msg.append(", ");
+ }
+ }
+ msg.append(']');
+ } else if (errCtx instanceof HashSet) {
+ HashSet vals = (HashSet)(errCtx);
+ msg.append("<SCXML> : [");
+ Iterator i = vals.iterator();
+ while(i.hasNext()) {
+ TransitionTarget tx = (TransitionTarget)i.next();
+ msg.append(Tracer.getTTPath(tx));
+ if(i.hasNext()) {
+ msg.append(", ");
+ }
+ }
+ msg.append(']');
+ }
+ }
+ log.warn(msg.toString());
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onEntry(org.apache.taglibs.rdc.scxml.model.TransitionTarget)
+ */
+ public void onEntry(TransitionTarget state) {
+ log.info(Tracer.getTTPath(state));
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onExit(org.apache.taglibs.rdc.scxml.model.TransitionTarget)
+ */
+ public void onExit(TransitionTarget state) {
+ log.info(Tracer.getTTPath(state));
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.SCXMLListener#onTransition(org.apache.taglibs.rdc.scxml.model.TransitionTarget, org.apache.taglibs.rdc.scxml.model.TransitionTarget, org.apache.taglibs.rdc.scxml.model.Transition)
+ */
+ public void onTransition(TransitionTarget from, TransitionTarget to,
+ Transition transition) {
+ log.info(transToString(from, to, transition));
+ }
+
+ private static final String transToString(TransitionTarget from,
+ TransitionTarget to, Transition transition) {
+ StringBuffer buf = new StringBuffer("transition (");
+ buf.append("event = ").append(transition.getEvent());
+ buf.append(", cond = ").append(transition.getCond());
+ buf.append(", from = ").append(Tracer.getTTPath(from));
+ buf.append(", to = ").append(Tracer.getTTPath(to));
+ buf.append(')');
+ return buf.toString();
+ }
+
+ /**
+ * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
+ */
+ public void warning(SAXParseException exception) throws SAXException {
+ log.warn(exception.getMessage(), exception);
+ }
+
+ /**
+ * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
+ */
+ public void error(SAXParseException exception) throws SAXException {
+ log.error(exception.getMessage(), exception);
+ }
+
+ /**
+ * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
+ */
+ public void fatalError(SAXParseException exception) throws SAXException {
+ log.fatal(exception.getMessage(), exception);
+ }
+
+ private static final String getTTPath(TransitionTarget tt) {
+ if(tt.getParent() == null) {
+ return "/" + tt.getId();
+ } else {
+ LinkedList ll = new LinkedList();
+ while(tt != null) {
+ ll.addFirst(tt);
+ tt = tt.getParent();
+ }
+ Iterator i = ll.iterator();
+ StringBuffer names = new StringBuffer();
+ while(i.hasNext()) {
+ TransitionTarget tmp = (TransitionTarget)i.next();
+ names.append('/').append(tmp.getId());
+ }
+ return names.toString();
+ }
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/URLResolver.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/URLResolver.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/URLResolver.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/env/URLResolver.java Wed Aug 10 14:10:59 2005
@@ -29,43 +29,43 @@
* @author Jaroslav Gergic
*/
public class URLResolver implements PathResolver {
-
- URL baseURL = null;
-
- /**
- * @param baseURL
- */
- public URLResolver(URL baseURL) {
- this.baseURL = baseURL;
- }
-
- /**
- * Uses URL(URL, String) constructor to combine URL's
- * @see org.apache.taglibs.rdc.scxml.PathResolver#resolvePath(java.lang.String)
- */
- public String resolvePath(String ctxPath) {
- URL combined;
- try {
- combined = new URL(baseURL, ctxPath);
- return combined.toString();
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * @see org.apache.taglibs.rdc.scxml.PathResolver#getResolver(java.lang.String)
- */
- public PathResolver getResolver(String ctxPath) {
- URL combined;
- try {
- combined = new URL(baseURL, ctxPath);
- return new URLResolver(combined);
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- return null;
- }
+
+ URL baseURL = null;
+
+ /**
+ * @param baseURL
+ */
+ public URLResolver(URL baseURL) {
+ this.baseURL = baseURL;
+ }
+
+ /**
+ * Uses URL(URL, String) constructor to combine URL's
+ * @see org.apache.taglibs.rdc.scxml.PathResolver#resolvePath(java.lang.String)
+ */
+ public String resolvePath(String ctxPath) {
+ URL combined;
+ try {
+ combined = new URL(baseURL, ctxPath);
+ return combined.toString();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * @see org.apache.taglibs.rdc.scxml.PathResolver#getResolver(java.lang.String)
+ */
+ public PathResolver getResolver(String ctxPath) {
+ URL combined;
+ try {
+ combined = new URL(baseURL, ctxPath);
+ return new URLResolver(combined);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Action.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Action.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Action.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Action.java Wed Aug 10 14:10:59 2005
@@ -25,53 +25,53 @@
* @author Jaroslav Gergic
*/
public abstract class Action {
-
- /**
- * Link to its parent or container
- */
- private Executable parent;
-
- /**
- * Constructor
- */
- public Action() {
- super();
- }
-
- /**
- * Get the Executable parent
- *
- * @return Returns the parent.
- */
- public Executable getParent() {
- return parent;
- }
-
- /**
- * Set the Executable parent
- *
- * @param parent The parent to set.
- */
- public void setParent(Executable parent) {
- this.parent = parent;
- }
+
+ /**
+ * Link to its parent or container
+ */
+ private Executable parent;
+
+ /**
+ * Constructor
+ */
+ public Action() {
+ super();
+ }
+
+ /**
+ * Get the Executable parent
+ *
+ * @return Returns the parent.
+ */
+ public Executable getParent() {
+ return parent;
+ }
+
+ /**
+ * Set the Executable parent
+ *
+ * @param parent The parent to set.
+ */
+ public void setParent(Executable parent) {
+ this.parent = parent;
+ }
- /**
- * Return the parent state
- *
- * @return The parent State
- */
- public State getParentState() throws ModelException {
- TransitionTarget tt = parent.getParent();
- if (tt instanceof State) {
- State st = (State) tt;
- return st;
- } else if (tt instanceof Parallel || tt instanceof History) {
- State st = (State) tt.getParent();
- return st;
- } else {
- throw new ModelException("Unknown TransitionTarget subclass:"
- + tt.getClass().getName());
- }
- }
+ /**
+ * Return the parent state
+ *
+ * @return The parent State
+ */
+ public State getParentState() throws ModelException {
+ TransitionTarget tt = parent.getParent();
+ if (tt instanceof State) {
+ State st = (State) tt;
+ return st;
+ } else if (tt instanceof Parallel || tt instanceof History) {
+ State st = (State) tt.getParent();
+ return st;
+ } else {
+ throw new ModelException("Unknown TransitionTarget subclass:"
+ + tt.getClass().getName());
+ }
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Assign.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Assign.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Assign.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Assign.java Wed Aug 10 14:10:59 2005
@@ -25,59 +25,59 @@
* @author Jaroslav Gergic
*/
public class Assign extends Action {
-
+
/**
* Left hand side expression evaluating to a previously
* defined variable
*/
- private String name;
+ private String name;
/**
* Expression evaluating to the new value of the variable.
*/
- private String expr;
-
- /**
- * Constructor
- */
- public Assign() {
- super();
- }
-
- /**
- * Get the expr that will evaluate to the new value
- *
- * @return Returns the expr.
- */
- public String getExpr() {
- return expr;
- }
-
- /**
- * Set the expr that will evaluate to the new value
- *
- * @param expr The expr to set.
- */
- public void setExpr(String expr) {
- this.expr = expr;
- }
-
- /**
- * Get the variable to be assigned a new value
- *
- * @return Returns the name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get the variable to be assigned a new value
- *
- * @param name The name to set.
- */
- public void setName(String name) {
- this.name = name;
- }
-
+ private String expr;
+
+ /**
+ * Constructor
+ */
+ public Assign() {
+ super();
+ }
+
+ /**
+ * Get the expr that will evaluate to the new value
+ *
+ * @return Returns the expr.
+ */
+ public String getExpr() {
+ return expr;
+ }
+
+ /**
+ * Set the expr that will evaluate to the new value
+ *
+ * @param expr The expr to set.
+ */
+ public void setExpr(String expr) {
+ this.expr = expr;
+ }
+
+ /**
+ * Get the variable to be assigned a new value
+ *
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the variable to be assigned a new value
+ *
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Cancel.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Cancel.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Cancel.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Cancel.java Wed Aug 10 14:10:59 2005
@@ -25,35 +25,35 @@
* @author Jaroslav Gergic
*/
public class Cancel extends Action {
-
- /**
- * Constructor
- */
- public Cancel() {
- super();
- }
-
+
+ /**
+ * Constructor
+ */
+ public Cancel() {
+ super();
+ }
+
/**
* The ID of the send message that should be cancelled.
*/
- private String sendId;
+ private String sendId;
- /**
- * Get the ID of the send message that should be cancelled.
- *
- * @return Returns the sendId.
- */
- public String getSendId() {
- return sendId;
- }
-
- /**
- * Set the ID of the send message that should be cancelled.
- *
- * @param sendId The sendId to set.
- */
- public void setSendId(String sendId) {
- this.sendId = sendId;
- }
-
+ /**
+ * Get the ID of the send message that should be cancelled.
+ *
+ * @return Returns the sendId.
+ */
+ public String getSendId() {
+ return sendId;
+ }
+
+ /**
+ * Set the ID of the send message that should be cancelled.
+ *
+ * @param sendId The sendId to set.
+ */
+ public void setSendId(String sendId) {
+ this.sendId = sendId;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Else.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Else.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Else.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Else.java Wed Aug 10 14:10:59 2005
@@ -25,13 +25,13 @@
* @author Jaroslav Gergic
*/
public class Else extends ElseIf {
-
- /**
- * <else/> is equivalent to <elseif cond="true" />
- */
- public Else() {
- super();
- setCond("true");
- }
-
+
+ /**
+ * <else/> is equivalent to <elseif cond="true" />
+ */
+ public Else() {
+ super();
+ setCond("true");
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ElseIf.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ElseIf.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ElseIf.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ElseIf.java Wed Aug 10 14:10:59 2005
@@ -25,35 +25,35 @@
* @author Jaroslav Gergic
*/
public class ElseIf extends Action {
-
+
/**
* An conditional expression which can be evaluated to true or false.
*/
- private String cond;
-
- /**
- * Constructor
- */
- public ElseIf() {
- super();
- }
-
- /**
- * Get the conditional expression
- *
- * @return Returns the cond.
- */
- public String getCond() {
- return cond;
- }
-
- /**
- * Set the conditional expression
- *
- * @param cond The cond to set.
- */
- public void setCond(String cond) {
- this.cond = cond;
- }
-
+ private String cond;
+
+ /**
+ * Constructor
+ */
+ public ElseIf() {
+ super();
+ }
+
+ /**
+ * Get the conditional expression
+ *
+ * @return Returns the cond.
+ */
+ public String getCond() {
+ return cond;
+ }
+
+ /**
+ * Set the conditional expression
+ *
+ * @param cond The cond to set.
+ */
+ public void setCond(String cond) {
+ this.cond = cond;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Executable.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Executable.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Executable.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Executable.java Wed Aug 10 14:10:59 2005
@@ -33,58 +33,58 @@
* The set of executable elements (those that inheriting from
* Action) that are contained in this Executable.
*/
- private List actions;
-
- /**
- * The parent container, for traceability
- */
- protected TransitionTarget parent;
-
- /**
- * Constructor
- */
- public Executable() {
- super();
- this.actions = new ArrayList();
- }
-
- /**
- * Get the executable actions contained in this Executable
- *
- * @return Returns the actions.
- */
- public List getActions() {
- return actions;
- }
-
- /**
- * Add an Action to the list of executable actions contained in
- * this Executable
- *
- * @param action The action to add.
- */
- public void addAction(Action action) {
- if (action != null) {
- this.actions.add(action);
- }
- }
-
- /**
- * Get the TransitionTarget parent
- *
- * @return Returns the parent.
- */
- public TransitionTarget getParent() {
- return parent;
- }
-
- /**
- * Set the TransitionTarget parent
- *
- * @param parent The parent to set.
- */
- public void setParent(TransitionTarget parent) {
- this.parent = parent;
- }
-
+ private List actions;
+
+ /**
+ * The parent container, for traceability
+ */
+ protected TransitionTarget parent;
+
+ /**
+ * Constructor
+ */
+ public Executable() {
+ super();
+ this.actions = new ArrayList();
+ }
+
+ /**
+ * Get the executable actions contained in this Executable
+ *
+ * @return Returns the actions.
+ */
+ public List getActions() {
+ return actions;
+ }
+
+ /**
+ * Add an Action to the list of executable actions contained in
+ * this Executable
+ *
+ * @param action The action to add.
+ */
+ public void addAction(Action action) {
+ if (action != null) {
+ this.actions.add(action);
+ }
+ }
+
+ /**
+ * Get the TransitionTarget parent
+ *
+ * @return Returns the parent.
+ */
+ public TransitionTarget getParent() {
+ return parent;
+ }
+
+ /**
+ * Set the TransitionTarget parent
+ *
+ * @param parent The parent to set.
+ */
+ public void setParent(TransitionTarget parent) {
+ this.parent = parent;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Exit.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Exit.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Exit.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Exit.java Wed Aug 10 14:10:59 2005
@@ -27,57 +27,57 @@
*/
public class Exit extends Action {
- /**
+ /**
* The optional expression
*/
- private String expr;
-
+ private String expr;
+
/**
* The optional namelist
*/
- private String namelist;
-
- /**
- * Constructor
- */
- public Exit() {
- super();
- }
-
- /**
- * Get the expression
- *
- * @return Returns the expr.
- */
- public String getExpr() {
- return expr;
- }
-
- /**
- * Set the expression
- *
- * @param expr The expr to set.
- */
- public void setExpr(String expr) {
- this.expr = expr;
- }
-
- /**
- * Get the namelist
- *
- * @return Returns the namelist.
- */
- public String getNamelist() {
- return namelist;
- }
-
- /**
- * Set the namelist
- *
- * @param namelist The namelist to set.
- */
- public void setNamelist(String namelist) {
- this.namelist = namelist;
- }
-
+ private String namelist;
+
+ /**
+ * Constructor
+ */
+ public Exit() {
+ super();
+ }
+
+ /**
+ * Get the expression
+ *
+ * @return Returns the expr.
+ */
+ public String getExpr() {
+ return expr;
+ }
+
+ /**
+ * Set the expression
+ *
+ * @param expr The expr to set.
+ */
+ public void setExpr(String expr) {
+ this.expr = expr;
+ }
+
+ /**
+ * Get the namelist
+ *
+ * @return Returns the namelist.
+ */
+ public String getNamelist() {
+ return namelist;
+ }
+
+ /**
+ * Set the namelist
+ *
+ * @param namelist The namelist to set.
+ */
+ public void setNamelist(String namelist) {
+ this.namelist = namelist;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ExternalNode.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ExternalNode.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ExternalNode.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ExternalNode.java Wed Aug 10 14:10:59 2005
@@ -25,12 +25,12 @@
* @author Jaroslav Gergic
*/
public class ExternalNode {
-
- /**
- * Constructor
- */
- public ExternalNode() {
- super();
- }
-
+
+ /**
+ * Constructor
+ */
+ public ExternalNode() {
+ super();
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/History.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/History.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/History.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/History.java Wed Aug 10 14:10:59 2005
@@ -29,18 +29,18 @@
*/
public class History extends TransitionTarget {
- /**
+ /**
* Whether this is a shallow or deep history, the default is shallow.
*/
- private boolean isDeep;
+ private boolean isDeep;
/**
* A conditionless transition representing the default history state
* and indicates the state to transition to if the parent state has
* never been entered before.
*/
- private Transition transition;
-
+ private Transition transition;
+
/**
* The configuration when the parent of this pseudo state was last
* exited.
@@ -48,83 +48,83 @@
private Set lastConfiguration;
/**
- * Default no-args constructor for XML Digester
- */
- public History() {
- super();
- }
-
- /**
- * Get the transition
- *
- * @return Returns the transition.
- */
- public Transition getTransition() {
- return transition;
- }
-
- /**
- * Set the transition
- *
- * @param transition The transition to set.
- */
- public void setTransition(Transition transition) {
- this.transition = transition;
- }
-
- /**
- * Is this history "deep" (as against "shallow")
- *
- * @return Returns whether this is a "deep" history
- */
- public boolean isDeep() {
- return isDeep;
- }
-
- /**
- * This method is invoked by XML digester when parsing SCXML markup
- *
- * @param type The history type, which can be "shallow" or
- * "deep"
- */
- public void setType(String type) {
- if(type.equals("deep")) {
- isDeep = true;
- }
- //shallow is by default
- }
-
- /**
- * Get the last configuration for this history
- *
- * @return Returns the lastConfiguration.
- */
- public Set getLastConfiguration() {
- return lastConfiguration;
- }
-
- /**
- * Set the last configuration for this history
- *
- * @param lc The lastConfiguration to set.
- */
- public void setLastConfiguration(Set lc) {
- if(this.lastConfiguration == null) {
- this.lastConfiguration = new HashSet(lc.size());
- } else {
- this.lastConfiguration.clear();
- }
- this.lastConfiguration.addAll(lc);
- }
-
- /**
- * Check whether we have prior history
- *
- * @return Whether we have a non-empty last configuration
- */
- public boolean isEmpty() {
- return (lastConfiguration == null || lastConfiguration.isEmpty()) ?
- true : false;
- }
+ * Default no-args constructor for XML Digester
+ */
+ public History() {
+ super();
+ }
+
+ /**
+ * Get the transition
+ *
+ * @return Returns the transition.
+ */
+ public Transition getTransition() {
+ return transition;
+ }
+
+ /**
+ * Set the transition
+ *
+ * @param transition The transition to set.
+ */
+ public void setTransition(Transition transition) {
+ this.transition = transition;
+ }
+
+ /**
+ * Is this history "deep" (as against "shallow")
+ *
+ * @return Returns whether this is a "deep" history
+ */
+ public boolean isDeep() {
+ return isDeep;
+ }
+
+ /**
+ * This method is invoked by XML digester when parsing SCXML markup
+ *
+ * @param type The history type, which can be "shallow" or
+ * "deep"
+ */
+ public void setType(String type) {
+ if(type.equals("deep")) {
+ isDeep = true;
+ }
+ //shallow is by default
+ }
+
+ /**
+ * Get the last configuration for this history
+ *
+ * @return Returns the lastConfiguration.
+ */
+ public Set getLastConfiguration() {
+ return lastConfiguration;
+ }
+
+ /**
+ * Set the last configuration for this history
+ *
+ * @param lc The lastConfiguration to set.
+ */
+ public void setLastConfiguration(Set lc) {
+ if(this.lastConfiguration == null) {
+ this.lastConfiguration = new HashSet(lc.size());
+ } else {
+ this.lastConfiguration.clear();
+ }
+ this.lastConfiguration.addAll(lc);
+ }
+
+ /**
+ * Check whether we have prior history
+ *
+ * @return Whether we have a non-empty last configuration
+ */
+ public boolean isEmpty() {
+ return (lastConfiguration == null || lastConfiguration.isEmpty()) ?
+ true : false;
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/If.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/If.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/If.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/If.java Wed Aug 10 14:10:59 2005
@@ -31,63 +31,63 @@
* @author Jaroslav Gergic
*/
public class If extends Action {
-
+
/**
* An conditional expression which can be evaluated to true or false.
*/
- private String cond;
+ private String cond;
/**
* The set of executable elements (those that inheriting from
* Action) that are contained in this <if> element.
*/
- private List actions;
-
- /**
- * Constructor
- */
- public If() {
- super();
- this.actions = new ArrayList();
- }
-
- /**
- * Get the executable actions contained in this <if>
- *
- * @return Returns the actions.
- */
- public List getActions() {
- return actions;
- }
+ private List actions;
+
+ /**
+ * Constructor
+ */
+ public If() {
+ super();
+ this.actions = new ArrayList();
+ }
+
+ /**
+ * Get the executable actions contained in this <if>
+ *
+ * @return Returns the actions.
+ */
+ public List getActions() {
+ return actions;
+ }
- /**
- * Add an Action to the list of executable actions contained in
- * this <if>
- *
- * @param action The action to add.
- */
- public void addAction(Action action) {
- if (action != null) {
- this.actions.add(action);
- }
- }
-
- /**
- * Get the conditional expression
- *
- * @return Returns the cond.
- */
- public String getCond() {
- return cond;
- }
-
- /**
- * Set the conditional expression
- *
- * @param cond The cond to set.
- */
- public void setCond(String cond) {
- this.cond = cond;
- }
-
+ /**
+ * Add an Action to the list of executable actions contained in
+ * this <if>
+ *
+ * @param action The action to add.
+ */
+ public void addAction(Action action) {
+ if (action != null) {
+ this.actions.add(action);
+ }
+ }
+
+ /**
+ * Get the conditional expression
+ *
+ * @return Returns the cond.
+ */
+ public String getCond() {
+ return cond;
+ }
+
+ /**
+ * Set the conditional expression
+ *
+ * @param cond The cond to set.
+ */
+ public void setCond(String cond) {
+ this.cond = cond;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Initial.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Initial.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Initial.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Initial.java Wed Aug 10 14:10:59 2005
@@ -25,37 +25,37 @@
* @author Jaroslav Gergic
*/
public class Initial extends TransitionTarget {
-
- /**
- * Constructor
- */
- public Initial() {
- super();
- }
-
- /**
- * A conditionless transition that is always enabled and will be taken
- * as soon as the state is entered. The target of the transition must
- * be a descendant of the parent state of initial.
- */
- private Transition transition;
-
- /**
- * Get the initial transition
- *
- * @return Returns the transition.
- */
- public Transition getTransition() {
- return transition;
- }
-
- /**
- * Set the initial transition
- *
- * @param transition The transition to set.
- */
- public void setTransition(Transition transition) {
- this.transition = transition;
- }
-
+
+ /**
+ * Constructor
+ */
+ public Initial() {
+ super();
+ }
+
+ /**
+ * A conditionless transition that is always enabled and will be taken
+ * as soon as the state is entered. The target of the transition must
+ * be a descendant of the parent state of initial.
+ */
+ private Transition transition;
+
+ /**
+ * Get the initial transition
+ *
+ * @return Returns the transition.
+ */
+ public Transition getTransition() {
+ return transition;
+ }
+
+ /**
+ * Set the initial transition
+ *
+ * @param transition The transition to set.
+ */
+ public void setTransition(Transition transition) {
+ this.transition = transition;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Log.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Log.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Log.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Log.java Wed Aug 10 14:10:59 2005
@@ -25,59 +25,59 @@
* @author Jaroslav Gergic
*/
public class Log extends Action {
-
+
/**
* An expression evaluating to a string to be logged.
*/
- private String expr;
+ private String expr;
/**
* An expression which returns string which may be used, for example,
* to indicate the purpose of the log.
*/
- private String label;
-
- /**
- * Constructor
- */
- public Log() {
- super();
- }
-
- /**
- * Get the log expression
- *
- * @return Returns the expression.
- */
- public String getExpr() {
- return expr;
- }
-
- /**
- * Set the log expression
- *
- * @param expr The expr to set.
- */
- public void setExpr(String expr) {
- this.expr = expr;
- }
-
- /**
- * Get the log label
- *
- * @return Returns the label.
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * Set the log label
- *
- * @param label The label to set.
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
+ private String label;
+
+ /**
+ * Constructor
+ */
+ public Log() {
+ super();
+ }
+
+ /**
+ * Get the log expression
+ *
+ * @return Returns the expression.
+ */
+ public String getExpr() {
+ return expr;
+ }
+
+ /**
+ * Set the log expression
+ *
+ * @param expr The expr to set.
+ */
+ public void setExpr(String expr) {
+ this.expr = expr;
+ }
+
+ /**
+ * Get the log label
+ *
+ * @return Returns the label.
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Set the log label
+ *
+ * @param label The label to set.
+ */
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ModelException.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ModelException.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ModelException.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/ModelException.java Wed Aug 10 14:10:59 2005
@@ -27,37 +27,37 @@
*/
public class ModelException extends Exception {
- /**
- * @see java.lang.Exception#Exception()
- */
- public ModelException() {
- super();
- }
+ /**
+ * @see java.lang.Exception#Exception()
+ */
+ public ModelException() {
+ super();
+ }
- /**
- * @see java.lang.Exception#Exception(java.lang.String)
- * @param message
- */
- public ModelException(String message) {
- super(message);
- }
+ /**
+ * @see java.lang.Exception#Exception(java.lang.String)
+ * @param message
+ */
+ public ModelException(String message) {
+ super(message);
+ }
- /**
- * @see java.lang.Exception#Exception(java.lang.Throwable)
- * @param cause
- */
- public ModelException(Throwable cause) {
- super(cause);
- }
-
- /**
- * @see java.lang.Exception#Exception(java.lang.String, java.lang.Throwable)
- * @param message
- * @param cause
- */
- public ModelException(String message, Throwable cause) {
- super(message, cause);
- }
+ /**
+ * @see java.lang.Exception#Exception(java.lang.Throwable)
+ * @param cause
+ */
+ public ModelException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * @see java.lang.Exception#Exception(java.lang.String, java.lang.Throwable)
+ * @param message
+ * @param cause
+ */
+ public ModelException(String message, Throwable cause) {
+ super(message, cause);
+ }
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnEntry.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnEntry.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnEntry.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnEntry.java Wed Aug 10 14:10:59 2005
@@ -27,12 +27,12 @@
* @author Jaroslav Gergic
*/
public class OnEntry extends Executable {
-
- /**
- * Constructor
- */
- public OnEntry() {
- super();
- }
-
+
+ /**
+ * Constructor
+ */
+ public OnEntry() {
+ super();
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnExit.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnExit.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnExit.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/OnExit.java Wed Aug 10 14:10:59 2005
@@ -27,12 +27,12 @@
* @author Jaroslav Gergic
*/
public class OnExit extends Executable {
-
- /**
- * Constructor
- */
- public OnExit() {
- super();
- }
-
+
+ /**
+ * Constructor
+ */
+ public OnExit() {
+ super();
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Parallel.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Parallel.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Parallel.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Parallel.java Wed Aug 10 14:10:59 2005
@@ -32,39 +32,39 @@
* @author Jaroslav Gergic
*/
public class Parallel extends TransitionTarget {
-
+
/**
* The set of parallel state machines contained in this <parallel>.
*/
- private Set states;
-
- /**
- * Constructor
- */
- public Parallel() {
- this.states = new HashSet();
- }
-
- /**
- * Get the set of parallel state machines contained in this Parallel.
- *
- * @return Returns the state.
- */
- public Set getStates() {
- return states;
- }
-
- /**
- * Add a State to the list of parallel state machines contained
- * in this Parallel.
- *
- * @param state The state to add.
- */
- public void addState(State state) {
- if (state != null) {
- this.states.add(state);
- }
- }
-
+ private Set states;
+
+ /**
+ * Constructor
+ */
+ public Parallel() {
+ this.states = new HashSet();
+ }
+
+ /**
+ * Get the set of parallel state machines contained in this Parallel.
+ *
+ * @return Returns the state.
+ */
+ public Set getStates() {
+ return states;
+ }
+
+ /**
+ * Add a State to the list of parallel state machines contained
+ * in this Parallel.
+ *
+ * @param state The state to add.
+ */
+ public void addState(State state) {
+ if (state != null) {
+ this.states.add(state);
+ }
+ }
+
}
Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Path.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Path.java?rev=231329&r1=231328&r2=231329&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Path.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/scxml/model/Path.java Wed Aug 10 14:10:59 2005
@@ -32,121 +32,121 @@
*/
public class Path {
- private List upSeg = new ArrayList();
+ private List upSeg = new ArrayList();
- private List downSeg = new ArrayList();
+ private List downSeg = new ArrayList();
- private State scope = null;
+ private State scope = null;
- private boolean crossRegion = false;
+ private boolean crossRegion = false;
- Path(TransitionTarget source, TransitionTarget target) {
- if (target == null) {
- //a local "stay" transition
- scope = (State) source;
- //all segments remain empty
- } else {
- TransitionTarget tt = SCXMLHelper.getLCA(source, target);
- if (tt != null) {
- if (tt instanceof State) {
- scope = (State) tt;
- } else {
- scope = tt.getParentState();
- }
- if (scope == source || scope == target) {
- scope = scope.getParentState();
- }
- }
- tt = source;
- while (tt != scope) {
- upSeg.add(tt);
- if (tt instanceof State) {
- State st = (State) tt;
- if (st.isRegion()) {
- crossRegion = true;
- }
- }
- tt = tt.getParent();
- }
- tt = target;
- while (tt != scope) {
- downSeg.add(0, tt);
- if (tt instanceof State) {
- State st = (State) tt;
- if (st.isRegion()) {
- crossRegion = true;
- }
- }
- tt = tt.getParent();
- }
- }
- }
-
- /**
- * @return true when the path crosses a region border(s)
- * @see State#isRegion()
- */
- public boolean isCrossRegion() {
- return crossRegion;
- }
-
- /**
- * @return a list of exited regions sorted bottom-up; no order defined for
- * siblings
- */
- public List getRegionsExited() {
- LinkedList ll = new LinkedList();
- for (Iterator i = upSeg.iterator(); i.hasNext();) {
- Object o = i.next();
- if (o instanceof State) {
- State st = (State) o;
- if (st.isRegion()) {
- ll.add(st);
- }
- }
- }
- return ll;
- }
-
- /**
- * @return a list of entered regions sorted top-down; no order defined for
- * siblings
- */
- public List getRegionsEntered() {
- LinkedList ll = new LinkedList();
- for (Iterator i = downSeg.iterator(); i.hasNext();) {
- Object o = i.next();
- if (o instanceof State) {
- State st = (State) o;
- if (st.isRegion()) {
- ll.add(st);
- }
- }
- }
- return ll;
- }
-
- /**
- * @return scope of the transition path, null means global transition (SCXML
- * document level) Scope is the least state which is not being
- * exited nor entered by the transition.
- */
- public State getScope() {
- return scope;
- }
-
- /**
- * @return upward segment of the path up to the scope
- */
- public List getUpwardSegment() {
- return upSeg;
- }
-
- /**
- * @return downward segment from the scope to the target
- */
- public List getDownwardSegment() {
- return downSeg;
- }
+ Path(TransitionTarget source, TransitionTarget target) {
+ if (target == null) {
+ //a local "stay" transition
+ scope = (State) source;
+ //all segments remain empty
+ } else {
+ TransitionTarget tt = SCXMLHelper.getLCA(source, target);
+ if (tt != null) {
+ if (tt instanceof State) {
+ scope = (State) tt;
+ } else {
+ scope = tt.getParentState();
+ }
+ if (scope == source || scope == target) {
+ scope = scope.getParentState();
+ }
+ }
+ tt = source;
+ while (tt != scope) {
+ upSeg.add(tt);
+ if (tt instanceof State) {
+ State st = (State) tt;
+ if (st.isRegion()) {
+ crossRegion = true;
+ }
+ }
+ tt = tt.getParent();
+ }
+ tt = target;
+ while (tt != scope) {
+ downSeg.add(0, tt);
+ if (tt instanceof State) {
+ State st = (State) tt;
+ if (st.isRegion()) {
+ crossRegion = true;
+ }
+ }
+ tt = tt.getParent();
+ }
+ }
+ }
+
+ /**
+ * @return true when the path crosses a region border(s)
+ * @see State#isRegion()
+ */
+ public boolean isCrossRegion() {
+ return crossRegion;
+ }
+
+ /**
+ * @return a list of exited regions sorted bottom-up; no order defined for
+ * siblings
+ */
+ public List getRegionsExited() {
+ LinkedList ll = new LinkedList();
+ for (Iterator i = upSeg.iterator(); i.hasNext();) {
+ Object o = i.next();
+ if (o instanceof State) {
+ State st = (State) o;
+ if (st.isRegion()) {
+ ll.add(st);
+ }
+ }
+ }
+ return ll;
+ }
+
+ /**
+ * @return a list of entered regions sorted top-down; no order defined for
+ * siblings
+ */
+ public List getRegionsEntered() {
+ LinkedList ll = new LinkedList();
+ for (Iterator i = downSeg.iterator(); i.hasNext();) {
+ Object o = i.next();
+ if (o instanceof State) {
+ State st = (State) o;
+ if (st.isRegion()) {
+ ll.add(st);
+ }
+ }
+ }
+ return ll;
+ }
+
+ /**
+ * @return scope of the transition path, null means global transition (SCXML
+ * document level) Scope is the least state which is not being
+ * exited nor entered by the transition.
+ */
+ public State getScope() {
+ return scope;
+ }
+
+ /**
+ * @return upward segment of the path up to the scope
+ */
+ public List getUpwardSegment() {
+ return upSeg;
+ }
+
+ /**
+ * @return downward segment from the scope to the target
+ */
+ public List getDownwardSegment() {
+ return downSeg;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org