1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 package org.exolab.castor.xml.schema.simpletypes.factory;
37
38 import java.util.Vector;
39 import java.io.PrintWriter;
40
41 import org.exolab.castor.xml.schema.SimpleType;
42
43
44
45
46
47 public class Type {
48
49
50
51 private String name = null;
52
53
54
55
56 private String code = null;
57
58
59
60
61 private String base = null;
62
63
64
65
66 private String impl = null;
67
68
69
70
71 private String derivedBy = null;
72
73
74
75
76 private Class implClass = null;
77
78
79
80
81 private SimpleType simpleType = null;
82
83
84
85
86 private final Vector<TypeProperty> facet = new Vector<>(15);
87
88 public String getName() {
89 return name;
90 }
91
92 public String getCode() {
93 return code;
94 }
95
96 public String getBase() {
97 return base;
98 }
99
100 public String getImpl() {
101 return impl;
102 }
103
104 public String getDerivedBy() {
105 return derivedBy;
106 }
107
108 public Vector<TypeProperty> getFacet() {
109 return facet;
110 }
111
112 public Class getImplClass() {
113 return implClass;
114 }
115
116 public SimpleType getSimpleType() {
117 return simpleType;
118 }
119
120
121 public void setName(String name) {
122 this.name = name;
123 }
124
125 public void setCode(String code) {
126 this.code = code;
127 }
128
129 public void setBase(String base) {
130 this.base = base;
131 }
132
133 public void setDerivedBy(String derivedBy) {
134 this.derivedBy = derivedBy;
135 }
136
137 public void setSimpleType(SimpleType simpleType) {
138 this.simpleType = simpleType;
139 }
140
141
142
143
144
145 public void setImpl(String impl) {
146 this.impl = impl;
147 try {
148 String fullName = "org.exolab.castor.xml.schema.simpletypes." + impl;
149 implClass = Class.forName(fullName);
150 } catch (Exception e) {
151 implClass = null;
152 }
153 }
154
155
156
157
158 public void Print(PrintWriter output) {
159 output.println("name: " + name + " code: " + code + " base: " + base + " impl: " + impl
160 + " derivedBy: " + derivedBy);
161 output.println("Facets count: " + facet.size());
162
163 for (int index = 0; index < facet.size(); index++) {
164 ((TypeProperty) (facet.elementAt(index))).Print(output);
165 }
166 output.println();
167 }
168
169
170
171
172
173
174 public String toString() {
175 StringBuilder sb = new StringBuilder().append("name: ").append(name).append(" code: ")
176 .append(code).append(" base: ").append(base).append(" impl: ").append(impl)
177 .append(" derivedBy: ").append(derivedBy).append('\n').append("Facets count: ")
178 .append(facet.size()).append('\n');
179 for (TypeProperty tp : facet) {
180 sb.append(tp);
181 }
182 sb.append('\n');
183 return sb.toString();
184 }
185 }