01: package org.enhydra.shark.xpdl.elements;
02:
03: import org.enhydra.shark.xpdl.XMLAttribute;
04: import org.enhydra.shark.xpdl.XMLCollectionElement;
05: import org.enhydra.shark.xpdl.XPDLConstants;
06:
07: /**
08: * Represents coresponding element from XPDL schema.
09: *
10: * @author Sasa Bojanic
11: */
12: public class Tool extends XMLCollectionElement {
13:
14: public Tool(Tools parent) {
15: super (parent, true);
16: }
17:
18: protected void fillStructure() {
19: XMLAttribute attrType = new XMLAttribute(this , "Type", false,
20: new String[] { XPDLConstants.TOOL_TYPE_NONE,
21: XPDLConstants.TOOL_TYPE_APPLICATION,
22: XPDLConstants.TOOL_TYPE_PROCEDURE }, 0);
23: ActualParameters refActualParameters = new ActualParameters(
24: this ); // min=0
25: Description refDescription = new Description(this ); // min=0
26: ExtendedAttributes refExtendedAttributes = new ExtendedAttributes(
27: this ); // min=0
28:
29: super .fillStructure();
30: add(attrType);
31: add(refActualParameters);
32: add(refDescription);
33: add(refExtendedAttributes);
34: }
35:
36: public XMLAttribute getTypeAttribute() {
37: return (XMLAttribute) get("Type");
38: }
39:
40: public String getType() {
41: return getTypeAttribute().toValue();
42: }
43:
44: public void setTypeNONE() {
45: getTypeAttribute().setValue(XPDLConstants.TOOL_TYPE_NONE);
46: }
47:
48: public void setTypeAPPLICATION() {
49: getTypeAttribute()
50: .setValue(XPDLConstants.TOOL_TYPE_APPLICATION);
51: }
52:
53: public void setTypePROCEDURE() {
54: getTypeAttribute().setValue(XPDLConstants.TOOL_TYPE_PROCEDURE);
55: }
56:
57: public String getDescription() {
58: return get("Description").toValue();
59: }
60:
61: public void setDescription(String description) {
62: set("Description", description);
63: }
64:
65: public ActualParameters getActualParameters() {
66: return (ActualParameters) get("ActualParameters");
67: }
68:
69: public ExtendedAttributes getExtendedAttributes() {
70: return (ExtendedAttributes) get("ExtendedAttributes");
71: }
72: }
|