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 public class XmlSchemaType extends XmlSchemaAnnotated {
32
33 Object baseSchemaType;
34 XmlSchemaDatatype dataType;
35 XmlSchemaDerivationMethod deriveBy, finalDerivation, finalResolved;
36 boolean isMixed;
37
38
39 String name;
40
41 XmlSchema schema;
42
43
44
45
46 public XmlSchemaType(XmlSchema schema) {
47 this.schema = schema;
48 finalDerivation = new XmlSchemaDerivationMethod(Constants.BlockConstants.NONE);
49 }
50
51
52
53
54
55
56
57 public Object getBaseSchemaType() {
58 return baseSchemaType;
59 }
60
61
62
63
64
65 public QName getBaseSchemaTypeName() {
66 return null;
67 }
68
69 public XmlSchemaDatatype getDataType() {
70 return dataType;
71 }
72
73 public XmlSchemaDerivationMethod getDeriveBy() {
74 return deriveBy;
75 }
76
77 public XmlSchemaDerivationMethod getFinal() {
78 return finalDerivation;
79 }
80
81 public void setFinal(XmlSchemaDerivationMethod finalDerivation) {
82 this.finalDerivation = finalDerivation;
83 }
84
85 public XmlSchemaDerivationMethod getFinalResolved() {
86 return finalResolved;
87 }
88
89 public boolean isMixed() {
90 return isMixed;
91 }
92
93 public void setMixed(boolean isMixed) {
94 this.isMixed = isMixed;
95 }
96
97 public String getName() {
98 return name;
99 }
100
101 public void setName(String name) {
102 this.name = name;
103 }
104
105 public QName getQName() {
106 if(name == null) {
107 return null;
108 }
109 return new QName(schema.logicalTargetNamespace, name);
110 }
111
112 public String toString() {
113 if(name == null) {
114 return super.toString() + "[anonymous]";
115 } else if (schema.logicalTargetNamespace == null) {
116 return super.toString() + "[{}" + name + "]";
117
118 } else {
119 return super.toString() + "[{" + schema.logicalTargetNamespace + "}" + name + "]";
120 }
121 }
122 }