1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.ws.commons.schema;
21
22 import org.apache.ws.commons.schema.constants.Constants;
23
24 import javax.xml.namespace.QName;
25
26
27
28
29
30
31
32
33 public class XmlSchemaAttribute extends XmlSchemaAnnotated {
34
35 Object attributeType;
36 String defaultValue, fixedValue, name;
37 XmlSchemaForm form;
38 XmlSchemaSimpleType schemaType;
39 QName schemaTypeName, qualifiedName, refName;
40 XmlSchemaUse use;
41
42
43
44
45 public XmlSchemaAttribute() {
46 form = new XmlSchemaForm(XmlSchemaForm.NONE);
47 use = new XmlSchemaUse(Constants.BlockConstants.NONE);
48 }
49
50 public Object getAttributeType() {
51 return attributeType;
52 }
53
54 public String getDefaultValue() {
55 return defaultValue;
56 }
57
58 public void setDefaultValue(String defaultValue) {
59 this.defaultValue = defaultValue;
60 }
61
62 public String getFixedValue() {
63 return fixedValue;
64 }
65
66 public void setFixedValue(String fixedValue) {
67 this.fixedValue = fixedValue;
68 }
69
70 public XmlSchemaForm getForm() {
71 return form;
72 }
73
74 public void setSchemaForm(XmlSchemaForm form) {
75 this.form = form;
76 }
77
78 public QName getQName() {
79 return qualifiedName;
80 }
81
82 public void setQName(QName qualifiedName) {
83 this.qualifiedName = qualifiedName;
84 }
85
86 public String getName() {
87 return name;
88 }
89
90 public void setName(String name) {
91 this.name = name;
92 }
93
94 public QName getRefName() {
95 return refName;
96 }
97
98 public void setRefName(QName refName) {
99 this.refName = refName;
100 }
101
102 public XmlSchemaSimpleType getSchemaType() {
103 return schemaType;
104 }
105
106 public void setSchemaType(XmlSchemaSimpleType schemaType) {
107 this.schemaType = schemaType;
108 }
109
110 public QName getSchemaTypeName() {
111 return schemaTypeName;
112 }
113
114 public void setSchemaTypeName(QName schemaTypeName) {
115 this.schemaTypeName = schemaTypeName;
116 }
117
118 public XmlSchemaUse getUse() {
119 return use;
120 }
121
122 public void setUse(XmlSchemaUse use) {
123 this.use = use;
124 }
125
126 public String toString(String prefix, int tab) {
127 String xml = new String();
128
129 if (!prefix.equals("") && prefix.indexOf(":") == -1)
130 prefix += ":";
131
132 for (int i = 0; i < tab; i++)
133 xml += "\t";
134
135 xml += "<" + prefix + "attribute name=\"" + name + "\" type=\"" + schemaTypeName + "\"/>\n";
136
137 return xml;
138 }
139 }