KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > xpdl > elements > Tool


1 package org.enhydra.shark.xpdl.elements;
2
3 import org.enhydra.shark.xpdl.XMLAttribute;
4 import org.enhydra.shark.xpdl.XMLComplexElement;
5 import org.enhydra.shark.xpdl.XPDLConstants;
6
7 /**
8  * Represents coresponding element from XPDL schema.
9  *
10  * @author Sasa Bojanic
11  */

12 public class Tool extends XMLComplexElement {
13
14    public Tool (Tools parent){
15       super(parent, true);
16    }
17
18    protected void fillStructure () {
19       XMLAttribute attrId=new XMLAttribute(this,"Id", true); // required
20
XMLAttribute attrType=new XMLAttribute(this,"Type",
21             false,new String JavaDoc[] {
22                "",
23                XPDLConstants.TOOL_TYPE_APPLICATION,
24                XPDLConstants.TOOL_TYPE_PROCEDURE
25             }, 0);
26       ActualParameters refActualParameters=new ActualParameters(this); // min=0
27
Description refDescription=new Description(this); // min=0
28
ExtendedAttributes refExtendedAttributes=new ExtendedAttributes(this); // min=0
29

30       add(attrId);
31       add(attrType);
32       add(refActualParameters);
33       add(refDescription);
34       add(refExtendedAttributes);
35    }
36
37    public String JavaDoc getId () {
38       return get("Id").toValue();
39    }
40    public void setId (String JavaDoc id) {
41       set("Id",id);
42    }
43    public XMLAttribute getTypeAttribute() {
44       return (XMLAttribute)get("Type");
45    }
46    public String JavaDoc getType () {
47       return getTypeAttribute().toValue();
48    }
49    public void setTypeNONE () {
50       getTypeAttribute().setValue("");
51    }
52    public void setTypeAPPLICATION () {
53       getTypeAttribute().setValue(XPDLConstants.TOOL_TYPE_APPLICATION);
54    }
55    public void setTypePROCEDURE () {
56       getTypeAttribute().setValue(XPDLConstants.TOOL_TYPE_PROCEDURE);
57    }
58    public String JavaDoc getDescription() {
59       return get("Description").toValue();
60    }
61    public void setDescription(String JavaDoc description) {
62       set("Description",description);
63    }
64    public ActualParameters getActualParameters() {
65       return (ActualParameters)get("ActualParameters");
66    }
67    public ExtendedAttributes getExtendedAttributes() {
68       return (ExtendedAttributes)get("ExtendedAttributes");
69    }
70 }
71
Popular Tags