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 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); XMLAttribute attrIndex=new XMLAttribute(this,"Index", false); 22 XMLAttribute attrMode=new XMLAttribute(this,"Mode", 24 true,new String [] { 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 getDescription() { 41 return get("Description").toValue(); 42 } 43 public void setDescription(String description) { 44 set("Description",description); 45 } 46 public String getIndex() { 47 return get("Index").toValue(); 48 } 49 public void setIndex(String index) { 50 set("Index",index); 51 } 52 53 public XMLAttribute getModeAttribute() { 54 return (XMLAttribute)get("Mode"); 55 } 56 public String 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 |