KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > xml > elements > Deadline


1 /* Deadline.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.xml.elements;
12
13 import org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.panels.*;
15 import org.w3c.dom.*;
16
17 /**
18 * Represents a WfMC DTD element that has the similar name.
19 */

20 public class Deadline extends XMLComplexElement {
21    //private Set refXpression=new HashSet(); // min=0, max=unbounded
22
private DeadlineCondition refDeadlineCondition=new DeadlineCondition(); // min=1, max=1
23
private ExceptionName refExceptionName=new ExceptionName(); // min=1, max=1
24
private XMLAttribute attrExecution=new XMLAttribute("Execution",
25       new String JavaDoc[] {
26          "",
27          "ASYNCHR",
28          "SYNCHR"
29       },1);
30
31    /**
32    * Creates a new instance of the class.
33    */

34    public Deadline () {
35       super();
36
37       fillStructure ();
38    }
39
40    /**
41    * Defines the super-class method. Read the explanation for
42    * this method within XMLComplexElement class.
43    */

44    protected void fillStructure () {
45       complexStructure.add(attrExecution);
46       attributes.add(attrExecution);
47       refDeadlineCondition.setRequired(true);
48       complexStructure.add(refDeadlineCondition);
49       refExceptionName.setRequired(true);
50       complexStructure.add(refExceptionName);
51    }
52
53
54    public void fromXML (Node node) {
55       attrExecution.setValue("");
56       super.fromXML(node);
57    }
58
59    /**
60    * Overrides super-class method to retrieve the defined
61    * condition.
62    *
63    * @return The condition of transition.
64    */

65    public String JavaDoc toString () {
66       return refDeadlineCondition.toString();
67    }
68
69    public Object JavaDoc toValue () {
70       return refDeadlineCondition.toValue();
71    }
72
73    /**
74    * Used to create exact copy of instance of this class.
75    * The newly created instance will have all the properties
76    * same as the copied one.
77    *
78    * @return The newly created instance of this class.
79    */

80    public Object JavaDoc clone () {
81       Deadline c=(Deadline)super.clone();
82
83       c.attrExecution=(XMLAttribute)this.attrExecution.clone();
84       c.refDeadlineCondition=(DeadlineCondition)this.refDeadlineCondition.clone();
85       c.refExceptionName=(ExceptionName)this.refExceptionName.clone();
86       c.fillStructure();
87
88       return c;
89    }
90
91 }
92
Popular Tags