svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.utils / src / main / java / org / gvsig / utils / xmlEntity / generate / XmlTag.java @ 40561
History | View | Annotate | Download (12.6 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
/*
|
25 |
* This class was automatically generated with
|
26 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
|
27 |
* Schema.
|
28 |
* $Id: XmlTag.java 29631 2009-06-29 16:56:19Z jpiera $
|
29 |
*/
|
30 |
|
31 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
32 |
*
|
33 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
34 |
*
|
35 |
* This program is free software; you can redistribute it and/or
|
36 |
* modify it under the terms of the GNU General Public License
|
37 |
* as published by the Free Software Foundation; either version 2
|
38 |
* of the License, or (at your option) any later version.
|
39 |
*
|
40 |
* This program is distributed in the hope that it will be useful,
|
41 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
42 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
43 |
* GNU General Public License for more details.
|
44 |
*
|
45 |
* You should have received a copy of the GNU General Public License
|
46 |
* along with this program; if not, write to the Free Software
|
47 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
48 |
*
|
49 |
* For more information, contact:
|
50 |
*
|
51 |
* Generalitat Valenciana
|
52 |
* Conselleria d'Infraestructures i Transport
|
53 |
* Av. Blasco Ib??ez, 50
|
54 |
* 46010 VALENCIA
|
55 |
* SPAIN
|
56 |
*
|
57 |
* +34 963862235
|
58 |
* gvsig@gva.es
|
59 |
* www.gvsig.gva.es
|
60 |
*
|
61 |
* or
|
62 |
*
|
63 |
* IVER T.I. S.A
|
64 |
* Salamanca 50
|
65 |
* 46005 Valencia
|
66 |
* Spain
|
67 |
*
|
68 |
* +34 963163400
|
69 |
* dac@iver.es
|
70 |
*/
|
71 |
package org.gvsig.utils.xmlEntity.generate; |
72 |
|
73 |
//---------------------------------/
|
74 |
//- Imported classes and packages -/
|
75 |
//---------------------------------/
|
76 |
|
77 |
import java.util.Vector; |
78 |
|
79 |
import org.exolab.castor.xml.Marshaller; |
80 |
import org.exolab.castor.xml.Unmarshaller; |
81 |
|
82 |
/**
|
83 |
* Class XmlTag.
|
84 |
*
|
85 |
* @version $Revision: 29631 $ $Date: 2009-06-29 18:56:19 +0200 (lun, 29 jun 2009) $
|
86 |
*/
|
87 |
public class XmlTag implements java.io.Serializable { |
88 |
|
89 |
|
90 |
//--------------------------/
|
91 |
//- Class/Member Variables -/
|
92 |
//--------------------------/
|
93 |
|
94 |
/**
|
95 |
* Field _name
|
96 |
*/
|
97 |
private java.lang.String _name;
|
98 |
|
99 |
/**
|
100 |
* Field _propertyList
|
101 |
*/
|
102 |
private java.util.Vector _propertyList;
|
103 |
|
104 |
/**
|
105 |
* Field _xmlTagList
|
106 |
*/
|
107 |
private java.util.Vector _xmlTagList;
|
108 |
|
109 |
|
110 |
//----------------/
|
111 |
//- Constructors -/
|
112 |
//----------------/
|
113 |
|
114 |
public XmlTag() {
|
115 |
super();
|
116 |
_propertyList = new Vector(); |
117 |
_xmlTagList = new Vector(); |
118 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag()
|
119 |
|
120 |
|
121 |
//-----------/
|
122 |
//- Methods -/
|
123 |
//-----------/
|
124 |
|
125 |
/**
|
126 |
* Method addProperty
|
127 |
*
|
128 |
* @param vProperty
|
129 |
*/
|
130 |
public void addProperty(org.gvsig.utils.xmlEntity.generate.Property vProperty) |
131 |
throws java.lang.IndexOutOfBoundsException
|
132 |
{ |
133 |
_propertyList.addElement(vProperty); |
134 |
} //-- void addProperty(com.iver.utiles.xmlEntity.generate.Property)
|
135 |
|
136 |
/**
|
137 |
* Method addProperty
|
138 |
*
|
139 |
* @param index
|
140 |
* @param vProperty
|
141 |
*/
|
142 |
public void addProperty(int index, org.gvsig.utils.xmlEntity.generate.Property vProperty) |
143 |
throws java.lang.IndexOutOfBoundsException
|
144 |
{ |
145 |
_propertyList.insertElementAt(vProperty, index); |
146 |
} //-- void addProperty(int, com.iver.utiles.xmlEntity.generate.Property)
|
147 |
|
148 |
/**
|
149 |
* Method addXmlTag
|
150 |
*
|
151 |
* @param vXmlTag
|
152 |
*/
|
153 |
public void addXmlTag(org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
154 |
throws java.lang.IndexOutOfBoundsException
|
155 |
{ |
156 |
_xmlTagList.addElement(vXmlTag); |
157 |
} //-- void addXmlTag(com.iver.utiles.xmlEntity.generate.XmlTag)
|
158 |
|
159 |
/**
|
160 |
* Method addXmlTag
|
161 |
*
|
162 |
* @param index
|
163 |
* @param vXmlTag
|
164 |
*/
|
165 |
public void addXmlTag(int index, org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
166 |
throws java.lang.IndexOutOfBoundsException
|
167 |
{ |
168 |
_xmlTagList.insertElementAt(vXmlTag, index); |
169 |
} //-- void addXmlTag(int, com.iver.utiles.xmlEntity.generate.XmlTag)
|
170 |
|
171 |
/**
|
172 |
* Method enumerateProperty
|
173 |
*/
|
174 |
public java.util.Enumeration enumerateProperty()
|
175 |
{ |
176 |
return _propertyList.elements();
|
177 |
} //-- java.util.Enumeration enumerateProperty()
|
178 |
|
179 |
/**
|
180 |
* Method enumerateXmlTag
|
181 |
*/
|
182 |
public java.util.Enumeration enumerateXmlTag()
|
183 |
{ |
184 |
return _xmlTagList.elements();
|
185 |
} //-- java.util.Enumeration enumerateXmlTag()
|
186 |
|
187 |
/**
|
188 |
* Returns the value of field 'name'.
|
189 |
*
|
190 |
* @return the value of field 'name'.
|
191 |
*/
|
192 |
public java.lang.String getName()
|
193 |
{ |
194 |
return this._name; |
195 |
} //-- java.lang.String getName()
|
196 |
|
197 |
/**
|
198 |
* Method getProperty
|
199 |
*
|
200 |
* @param index
|
201 |
*/
|
202 |
public org.gvsig.utils.xmlEntity.generate.Property getProperty(int index) |
203 |
throws java.lang.IndexOutOfBoundsException
|
204 |
{ |
205 |
//-- check bounds for index
|
206 |
if ((index < 0) || (index > _propertyList.size())) { |
207 |
throw new IndexOutOfBoundsException(); |
208 |
} |
209 |
|
210 |
return (org.gvsig.utils.xmlEntity.generate.Property) _propertyList.elementAt(index);
|
211 |
} //-- com.iver.utiles.xmlEntity.generate.Property getProperty(int)
|
212 |
|
213 |
/**
|
214 |
* Method getProperty
|
215 |
*/
|
216 |
public org.gvsig.utils.xmlEntity.generate.Property[] getProperty() |
217 |
{ |
218 |
int size = _propertyList.size();
|
219 |
org.gvsig.utils.xmlEntity.generate.Property[] mArray = new org.gvsig.utils.xmlEntity.generate.Property[size]; |
220 |
for (int index = 0; index < size; index++) { |
221 |
mArray[index] = (org.gvsig.utils.xmlEntity.generate.Property) _propertyList.elementAt(index); |
222 |
} |
223 |
return mArray;
|
224 |
} //-- com.iver.utiles.xmlEntity.generate.Property[] getProperty()
|
225 |
|
226 |
/**
|
227 |
* Method getPropertyCount
|
228 |
*/
|
229 |
public int getPropertyCount() |
230 |
{ |
231 |
return _propertyList.size();
|
232 |
} //-- int getPropertyCount()
|
233 |
|
234 |
/**
|
235 |
* Method getXmlTag
|
236 |
*
|
237 |
* @param index
|
238 |
*/
|
239 |
public org.gvsig.utils.xmlEntity.generate.XmlTag getXmlTag(int index) |
240 |
throws java.lang.IndexOutOfBoundsException
|
241 |
{ |
242 |
//-- check bounds for index
|
243 |
if ((index < 0) || (index > _xmlTagList.size())) { |
244 |
throw new IndexOutOfBoundsException(); |
245 |
} |
246 |
|
247 |
return (org.gvsig.utils.xmlEntity.generate.XmlTag) _xmlTagList.elementAt(index);
|
248 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag getXmlTag(int)
|
249 |
|
250 |
/**
|
251 |
* Method getXmlTag
|
252 |
*/
|
253 |
public org.gvsig.utils.xmlEntity.generate.XmlTag[] getXmlTag() |
254 |
{ |
255 |
int size = _xmlTagList.size();
|
256 |
org.gvsig.utils.xmlEntity.generate.XmlTag[] mArray = new org.gvsig.utils.xmlEntity.generate.XmlTag[size]; |
257 |
for (int index = 0; index < size; index++) { |
258 |
mArray[index] = (org.gvsig.utils.xmlEntity.generate.XmlTag) _xmlTagList.elementAt(index); |
259 |
} |
260 |
return mArray;
|
261 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag[] getXmlTag()
|
262 |
|
263 |
/**
|
264 |
* Method getXmlTagCount
|
265 |
*/
|
266 |
public int getXmlTagCount() |
267 |
{ |
268 |
return _xmlTagList.size();
|
269 |
} //-- int getXmlTagCount()
|
270 |
|
271 |
/**
|
272 |
* Method isValid
|
273 |
*/
|
274 |
public boolean isValid() |
275 |
{ |
276 |
try {
|
277 |
validate(); |
278 |
} |
279 |
catch (org.exolab.castor.xml.ValidationException vex) {
|
280 |
return false; |
281 |
} |
282 |
return true; |
283 |
} //-- boolean isValid()
|
284 |
|
285 |
/**
|
286 |
* Method marshal
|
287 |
*
|
288 |
* @param out
|
289 |
*/
|
290 |
public void marshal(java.io.Writer out) |
291 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
292 |
{ |
293 |
|
294 |
Marshaller.marshal(this, out);
|
295 |
} //-- void marshal(java.io.Writer)
|
296 |
|
297 |
/**
|
298 |
* Method marshal
|
299 |
*
|
300 |
* @param handler
|
301 |
*/
|
302 |
public void marshal(org.xml.sax.ContentHandler handler) |
303 |
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
304 |
{ |
305 |
|
306 |
Marshaller.marshal(this, handler);
|
307 |
} //-- void marshal(org.xml.sax.ContentHandler)
|
308 |
|
309 |
/**
|
310 |
* Method removeAllProperty
|
311 |
*/
|
312 |
public void removeAllProperty() |
313 |
{ |
314 |
_propertyList.removeAllElements(); |
315 |
} //-- void removeAllProperty()
|
316 |
|
317 |
/**
|
318 |
* Method removeAllXmlTag
|
319 |
*/
|
320 |
public void removeAllXmlTag() |
321 |
{ |
322 |
_xmlTagList.removeAllElements(); |
323 |
} //-- void removeAllXmlTag()
|
324 |
|
325 |
/**
|
326 |
* Method removeProperty
|
327 |
*
|
328 |
* @param index
|
329 |
*/
|
330 |
public org.gvsig.utils.xmlEntity.generate.Property removeProperty(int index) |
331 |
{ |
332 |
java.lang.Object obj = _propertyList.elementAt(index); |
333 |
_propertyList.removeElementAt(index); |
334 |
return (org.gvsig.utils.xmlEntity.generate.Property) obj;
|
335 |
} //-- com.iver.utiles.xmlEntity.generate.Property removeProperty(int)
|
336 |
|
337 |
/**
|
338 |
* Method removeXmlTag
|
339 |
*
|
340 |
* @param index
|
341 |
*/
|
342 |
public org.gvsig.utils.xmlEntity.generate.XmlTag removeXmlTag(int index) |
343 |
{ |
344 |
java.lang.Object obj = _xmlTagList.elementAt(index); |
345 |
_xmlTagList.removeElementAt(index); |
346 |
return (org.gvsig.utils.xmlEntity.generate.XmlTag) obj;
|
347 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag removeXmlTag(int)
|
348 |
|
349 |
/**
|
350 |
* Sets the value of field 'name'.
|
351 |
*
|
352 |
* @param name the value of field 'name'.
|
353 |
*/
|
354 |
public void setName(java.lang.String name) |
355 |
{ |
356 |
this._name = name;
|
357 |
} //-- void setName(java.lang.String)
|
358 |
|
359 |
/**
|
360 |
* Method setProperty
|
361 |
*
|
362 |
* @param index
|
363 |
* @param vProperty
|
364 |
*/
|
365 |
public void setProperty(int index, org.gvsig.utils.xmlEntity.generate.Property vProperty) |
366 |
throws java.lang.IndexOutOfBoundsException
|
367 |
{ |
368 |
//-- check bounds for index
|
369 |
if ((index < 0) || (index > _propertyList.size())) { |
370 |
throw new IndexOutOfBoundsException(); |
371 |
} |
372 |
_propertyList.setElementAt(vProperty, index); |
373 |
} //-- void setProperty(int, com.iver.utiles.xmlEntity.generate.Property)
|
374 |
|
375 |
/**
|
376 |
* Method setProperty
|
377 |
*
|
378 |
* @param propertyArray
|
379 |
*/
|
380 |
public void setProperty(org.gvsig.utils.xmlEntity.generate.Property[] propertyArray) |
381 |
{ |
382 |
//-- copy array
|
383 |
_propertyList.removeAllElements(); |
384 |
for (int i = 0; i < propertyArray.length; i++) { |
385 |
_propertyList.addElement(propertyArray[i]); |
386 |
} |
387 |
} //-- void setProperty(com.iver.utiles.xmlEntity.generate.Property)
|
388 |
|
389 |
/**
|
390 |
* Method setXmlTag
|
391 |
*
|
392 |
* @param index
|
393 |
* @param vXmlTag
|
394 |
*/
|
395 |
public void setXmlTag(int index, org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
396 |
throws java.lang.IndexOutOfBoundsException
|
397 |
{ |
398 |
//-- check bounds for index
|
399 |
if ((index < 0) || (index > _xmlTagList.size())) { |
400 |
throw new IndexOutOfBoundsException(); |
401 |
} |
402 |
_xmlTagList.setElementAt(vXmlTag, index); |
403 |
} //-- void setXmlTag(int, com.iver.utiles.xmlEntity.generate.XmlTag)
|
404 |
|
405 |
/**
|
406 |
* Method setXmlTag
|
407 |
*
|
408 |
* @param xmlTagArray
|
409 |
*/
|
410 |
public void setXmlTag(org.gvsig.utils.xmlEntity.generate.XmlTag[] xmlTagArray) |
411 |
{ |
412 |
//-- copy array
|
413 |
_xmlTagList.removeAllElements(); |
414 |
for (int i = 0; i < xmlTagArray.length; i++) { |
415 |
_xmlTagList.addElement(xmlTagArray[i]); |
416 |
} |
417 |
} //-- void setXmlTag(com.iver.utiles.xmlEntity.generate.XmlTag)
|
418 |
|
419 |
/**
|
420 |
* Method unmarshal
|
421 |
*
|
422 |
* @param reader
|
423 |
*/
|
424 |
public static java.lang.Object unmarshal(java.io.Reader reader) |
425 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
426 |
{ |
427 |
return (org.gvsig.utils.xmlEntity.generate.XmlTag) Unmarshaller.unmarshal(org.gvsig.utils.xmlEntity.generate.XmlTag.class, reader);
|
428 |
} //-- java.lang.Object unmarshal(java.io.Reader)
|
429 |
|
430 |
/**
|
431 |
* Method validate
|
432 |
*/
|
433 |
public void validate() |
434 |
throws org.exolab.castor.xml.ValidationException
|
435 |
{ |
436 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
|
437 |
validator.validate(this);
|
438 |
} //-- void validate()
|
439 |
|
440 |
} |