KickJava   Java API By Example, From Geeks To Geeks.

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


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 ParticipantType extends XMLComplexElement {
13
14    public ParticipantType (Participant parent) {
15       super(parent, true);
16    }
17
18    protected void fillStructure () {
19       // required
20
XMLAttribute attrType=new XMLAttribute(this,"Type",
21          true,
22          new String JavaDoc[] {
23             XPDLConstants.PARTICIPANT_TYPE_RESOURCE_SET,
24             XPDLConstants.PARTICIPANT_TYPE_RESOURCE,
25             XPDLConstants.PARTICIPANT_TYPE_ROLE,
26             XPDLConstants.PARTICIPANT_TYPE_ORGANIZATIONAL_UNIT,
27             XPDLConstants.PARTICIPANT_TYPE_HUMAN,
28             XPDLConstants.PARTICIPANT_TYPE_SYSTEM
29          }, 2);
30
31       add(attrType);
32    }
33
34    public XMLAttribute getTypeAttribute() {
35       return (XMLAttribute)get("Type");
36    }
37
38    public String JavaDoc getType () {
39       return getTypeAttribute().toValue();
40    }
41    public void setTypeRESOURCE_SET () {
42       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_RESOURCE_SET);
43    }
44    public void setTypeRESOURCE () {
45       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_RESOURCE);
46    }
47    public void setTypeROLE () {
48       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_ROLE);
49    }
50    public void setTypeORGANIZATIONAL_UNIT () {
51       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_ORGANIZATIONAL_UNIT);
52    }
53    public void setTypeHUMAN () {
54       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_HUMAN);
55    }
56    public void setTypeSYSTEM () {
57       getTypeAttribute().setValue(XPDLConstants.PARTICIPANT_TYPE_SYSTEM);
58    }
59 }
60
Popular Tags