1
2
3
4
5
6
7
8
9 package org.jomc.modlet;
10
11 import java.util.ArrayList;
12 import java.util.Iterator;
13 import java.util.List;
14 import javax.annotation.Generated;
15 import javax.xml.bind.annotation.XmlAccessType;
16 import javax.xml.bind.annotation.XmlAccessorType;
17 import javax.xml.bind.annotation.XmlElement;
18 import javax.xml.bind.annotation.XmlType;
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 @XmlAccessorType(XmlAccessType.FIELD)
43 @XmlType(name = "Schemas", namespace = "http://jomc.org/modlet", propOrder = {
44 "schema"
45 })
46 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-06-03T09:42:31+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
47 public class Schemas
48 extends ModletObject
49 implements Cloneable
50 {
51
52 @XmlElement(namespace = "http://jomc.org/modlet")
53 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-06-03T09:42:31+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
54 protected List<Schema> schema;
55
56
57
58
59
60 public Schemas() {
61
62 super();
63 }
64
65
66
67
68
69
70
71
72
73
74 public Schemas(final Schemas o) {
75
76 super(o);
77 if (o == null) {
78 throw new NullPointerException("Cannot create a copy of 'Schemas' from 'null'.");
79 }
80
81 if (o.schema!= null) {
82 copySchema(o.getSchema(), this.getSchema());
83 }
84 }
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-06-03T09:42:31+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
109 public List<Schema> getSchema() {
110 if (schema == null) {
111 schema = new ArrayList<Schema>();
112 }
113 return this.schema;
114 }
115
116
117
118
119
120
121
122
123
124
125
126 @SuppressWarnings("unchecked")
127 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-06-03T09:42:31+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
128 private static void copySchema(final List<Schema> source, final List<Schema> target) {
129
130 if ((source!= null)&&(!source.isEmpty())) {
131 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
132 final Object next = it.next();
133 if (next instanceof Schema) {
134
135 target.add(((Schema) next).clone());
136 continue;
137 }
138
139 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Schema' of class 'org.jomc.modlet.Schemas'."));
140 }
141 }
142 }
143
144
145
146
147
148
149
150
151 @Override
152 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-06-03T09:42:31+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
153 public Schemas clone() {
154 {
155
156 final Schemas clone = ((Schemas) super.clone());
157
158 if (this.schema!= null) {
159 clone.schema = null;
160 copySchema(this.getSchema(), clone.getSchema());
161 }
162 return clone;
163 }
164 }
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180 @Deprecated
181 public Schema getSchemaByPublicId( final String publicId )
182 {
183 if ( publicId == null )
184 {
185 throw new NullPointerException( "publicId" );
186 }
187
188 for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
189 {
190 final Schema s = this.getSchema().get( i );
191
192 if ( publicId.equals( s.getPublicId() ) )
193 {
194 return s;
195 }
196 }
197
198 return null;
199 }
200
201
202
203
204
205
206
207
208
209
210
211
212
213 public Schema getSchemaBySystemId( final String systemId )
214 {
215 if ( systemId == null )
216 {
217 throw new NullPointerException( "systemId" );
218 }
219
220 for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
221 {
222 final Schema s = this.getSchema().get( i );
223
224 if ( systemId.equals( s.getSystemId() ) )
225 {
226 return s;
227 }
228 }
229
230 return null;
231 }
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246 public List<Schema> getSchemasByPublicId( final java.net.URI publicId )
247 {
248 if ( publicId == null )
249 {
250 throw new NullPointerException( "publicId" );
251 }
252
253 final List<Schema> schemas = new ArrayList<Schema>( this.getSchema().size() );
254
255 for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
256 {
257 final Schema s = this.getSchema().get( i );
258
259 if ( publicId.equals( s.getPublicIdUri() ) )
260 {
261 schemas.add( s );
262 }
263 }
264
265 return java.util.Collections.unmodifiableList( schemas );
266 }
267
268 }