KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.xpdl.elements;
2
3 import org.enhydra.shark.xpdl.XMLAttribute;
4 import org.enhydra.shark.xpdl.XMLCollectionElement;
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 FormalParameter extends XMLCollectionElement {
13
14    public FormalParameter (FormalParameters fps) {
15       super(fps, true);
16    }
17
18    protected void fillStructure () {
19       DataType refDataType=new DataType(this);
20       Description refDescription=new Description(this); // min=0
21
XMLAttribute attrIndex=new XMLAttribute(this,"Index", false);
22       // default="IN"
23
XMLAttribute attrMode=new XMLAttribute(this,"Mode",
24          true,new String JavaDoc[] {
25             XPDLConstants.FORMAL_PARAMETER_MODE_IN,
26             XPDLConstants.FORMAL_PARAMETER_MODE_OUT,
27             XPDLConstants.FORMAL_PARAMETER_MODE_INOUT
28          }, 0);
29
30       super.fillStructure();
31       add(attrIndex);
32       add(attrMode);
33       add(refDataType);
34       add(refDescription);
35    }
36
37    public DataType getDataType() {
38       return (DataType)get("DataType");
39    }
40    public String JavaDoc getDescription() {
41       return get("Description").toValue();
42    }
43    public void setDescription(String JavaDoc description) {
44       set("Description",description);
45    }
46    public String JavaDoc getIndex() {
47       return get("Index").toValue();
48    }
49    public void setIndex(String JavaDoc index) {
50       set("Index",index);
51    }
52
53    public XMLAttribute getModeAttribute() {
54       return (XMLAttribute)get("Mode");
55    }
56    public String JavaDoc getMode() {
57       return getModeAttribute().toValue();
58    }
59    public void setModeIN() {
60       getModeAttribute().setValue(XPDLConstants.FORMAL_PARAMETER_MODE_IN);
61    }
62    public void setModeOUT() {
63       getModeAttribute().setValue(XPDLConstants.FORMAL_PARAMETER_MODE_OUT);
64    }
65    public void setModeINOUT() {
66       getModeAttribute().setValue(XPDLConstants.FORMAL_PARAMETER_MODE_INOUT);
67    }
68    
69 }
70
Popular Tags