KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > data > exe > SimpleVariableInstance


1 package org.jbpm.bpel.data.exe;
2
3 import org.w3c.dom.Node JavaDoc;
4
5 import org.jbpm.bpel.xml.util.NodeUtil;
6
7 /**
8  * @author Alejandro Guízar
9  * @version $Revision: 1.4 $ $Date: 2005/06/23 02:22:46 $
10  */

11 public class SimpleVariableInstance extends VariableInstance {
12   
13   private Object JavaDoc value;
14   
15   public Object JavaDoc getValue() {
16     if (value == null) {
17       throw new RuntimeException JavaDoc("Uninitialized variable: variable=" + getDefinition().getName());
18     }
19     return value;
20   }
21
22   public void setValue(Object JavaDoc value) {
23     if (value instanceof Node JavaDoc) {
24       value = NodeUtil.getValue((Node JavaDoc) value);
25     }
26     // TODO perform type checking
27
this.value = value;
28   }
29   
30   public Object JavaDoc getOrCreateValue() {
31     return getValue();
32   }
33 }
34
Popular Tags