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 DataField extends XMLCollectionElement {
13:
14: public DataField(DataFields dfs) {
15: super (dfs, true);
16: }
17:
18: protected void fillStructure() {
19: DataType refDataType = new DataType(this );
20: InitialValue refInitialValue = new InitialValue(this ); // min=0
21: Length refLength = new Length(this ); // min=0
22: Description refDescription = new Description(this ); // min=0
23: ExtendedAttributes refExtendedAttributes = new ExtendedAttributes(
24: this ); // min=0
25:
26: XMLAttribute attrName = new XMLAttribute(this , "Name", false);
27: // default="FALSE"
28: XMLAttribute attrIsArray = new XMLAttribute(this , "IsArray",
29: false, new String[] {
30: XPDLConstants.DATA_FIELD_IS_ARRAY_TRUE,
31: XPDLConstants.DATA_FIELD_IS_ARRAY_FALSE }, 1);
32:
33: super .fillStructure();
34: add(attrName);
35: add(attrIsArray);
36: add(refDataType);
37: add(refInitialValue);
38: add(refLength);
39: add(refDescription);
40: add(refExtendedAttributes);
41:
42: }
43:
44: public XMLAttribute getIsArrayAttribute() {
45: return (XMLAttribute) get("IsArray");
46: }
47:
48: public boolean getIsArray() {
49: return new Boolean(get("IsArray").toValue()).booleanValue();
50: }
51:
52: public void setIsArray(boolean isArray) {
53: set("IsArray", String.valueOf(isArray).toUpperCase());
54: }
55:
56: public String getName() {
57: return get("Name").toValue();
58: }
59:
60: public void setName(String name) {
61: set("Name", name);
62: }
63:
64: public DataType getDataType() {
65: return (DataType) get("DataType");
66: }
67:
68: public String getDescription() {
69: return get("Description").toValue();
70: }
71:
72: public void setDescription(String description) {
73: set("Description", description);
74: }
75:
76: public ExtendedAttributes getExtendedAttributes() {
77: return (ExtendedAttributes) get("ExtendedAttributes");
78: }
79:
80: public String getInitialValue() {
81: return get("InitialValue").toValue();
82: }
83:
84: public void setInitialValue(String initialValue) {
85: set("InitialValue", initialValue);
86: }
87:
88: public String getLength() {
89: return get("Length").toValue();
90: }
91:
92: public void setLength(String length) {
93: set("Length", length);
94: }
95: }
|