svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.utils / src / main / java / org / gvsig / utils / xmlEntity / generate / XmlCastor.java @ 40561
History | View | Annotate | Download (8.31 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: XmlCastor.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 XmlCastor.
|
84 |
*
|
85 |
* @version $Revision: 29631 $ $Date: 2009-06-29 18:56:19 +0200 (lun, 29 jun 2009) $
|
86 |
*/
|
87 |
public class XmlCastor implements java.io.Serializable { |
88 |
|
89 |
|
90 |
//--------------------------/
|
91 |
//- Class/Member Variables -/
|
92 |
//--------------------------/
|
93 |
|
94 |
/**
|
95 |
* Field _xmlTagList
|
96 |
*/
|
97 |
private java.util.Vector _xmlTagList;
|
98 |
|
99 |
|
100 |
//----------------/
|
101 |
//- Constructors -/
|
102 |
//----------------/
|
103 |
|
104 |
public XmlCastor() {
|
105 |
super();
|
106 |
_xmlTagList = new Vector(); |
107 |
} //-- com.iver.utiles.xmlEntity.generate.XmlCastor()
|
108 |
|
109 |
|
110 |
//-----------/
|
111 |
//- Methods -/
|
112 |
//-----------/
|
113 |
|
114 |
/**
|
115 |
* Method addXmlTag
|
116 |
*
|
117 |
* @param vXmlTag
|
118 |
*/
|
119 |
public void addXmlTag(org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
120 |
throws java.lang.IndexOutOfBoundsException
|
121 |
{ |
122 |
_xmlTagList.addElement(vXmlTag); |
123 |
} //-- void addXmlTag(com.iver.utiles.xmlEntity.generate.XmlTag)
|
124 |
|
125 |
/**
|
126 |
* Method addXmlTag
|
127 |
*
|
128 |
* @param index
|
129 |
* @param vXmlTag
|
130 |
*/
|
131 |
public void addXmlTag(int index, org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
132 |
throws java.lang.IndexOutOfBoundsException
|
133 |
{ |
134 |
_xmlTagList.insertElementAt(vXmlTag, index); |
135 |
} //-- void addXmlTag(int, com.iver.utiles.xmlEntity.generate.XmlTag)
|
136 |
|
137 |
/**
|
138 |
* Method enumerateXmlTag
|
139 |
*/
|
140 |
public java.util.Enumeration enumerateXmlTag()
|
141 |
{ |
142 |
return _xmlTagList.elements();
|
143 |
} //-- java.util.Enumeration enumerateXmlTag()
|
144 |
|
145 |
/**
|
146 |
* Method getXmlTag
|
147 |
*
|
148 |
* @param index
|
149 |
*/
|
150 |
public org.gvsig.utils.xmlEntity.generate.XmlTag getXmlTag(int index) |
151 |
throws java.lang.IndexOutOfBoundsException
|
152 |
{ |
153 |
//-- check bounds for index
|
154 |
if ((index < 0) || (index > _xmlTagList.size())) { |
155 |
throw new IndexOutOfBoundsException(); |
156 |
} |
157 |
|
158 |
return (org.gvsig.utils.xmlEntity.generate.XmlTag) _xmlTagList.elementAt(index);
|
159 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag getXmlTag(int)
|
160 |
|
161 |
/**
|
162 |
* Method getXmlTag
|
163 |
*/
|
164 |
public org.gvsig.utils.xmlEntity.generate.XmlTag[] getXmlTag() |
165 |
{ |
166 |
int size = _xmlTagList.size();
|
167 |
org.gvsig.utils.xmlEntity.generate.XmlTag[] mArray = new org.gvsig.utils.xmlEntity.generate.XmlTag[size]; |
168 |
for (int index = 0; index < size; index++) { |
169 |
mArray[index] = (org.gvsig.utils.xmlEntity.generate.XmlTag) _xmlTagList.elementAt(index); |
170 |
} |
171 |
return mArray;
|
172 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag[] getXmlTag()
|
173 |
|
174 |
/**
|
175 |
* Method getXmlTagCount
|
176 |
*/
|
177 |
public int getXmlTagCount() |
178 |
{ |
179 |
return _xmlTagList.size();
|
180 |
} //-- int getXmlTagCount()
|
181 |
|
182 |
/**
|
183 |
* Method isValid
|
184 |
*/
|
185 |
public boolean isValid() |
186 |
{ |
187 |
try {
|
188 |
validate(); |
189 |
} |
190 |
catch (org.exolab.castor.xml.ValidationException vex) {
|
191 |
return false; |
192 |
} |
193 |
return true; |
194 |
} //-- boolean isValid()
|
195 |
|
196 |
/**
|
197 |
* Method marshal
|
198 |
*
|
199 |
* @param out
|
200 |
*/
|
201 |
public void marshal(java.io.Writer out) |
202 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
203 |
{ |
204 |
|
205 |
Marshaller.marshal(this, out);
|
206 |
} //-- void marshal(java.io.Writer)
|
207 |
|
208 |
/**
|
209 |
* Method marshal
|
210 |
*
|
211 |
* @param handler
|
212 |
*/
|
213 |
public void marshal(org.xml.sax.ContentHandler handler) |
214 |
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
215 |
{ |
216 |
|
217 |
Marshaller.marshal(this, handler);
|
218 |
} //-- void marshal(org.xml.sax.ContentHandler)
|
219 |
|
220 |
/**
|
221 |
* Method removeAllXmlTag
|
222 |
*/
|
223 |
public void removeAllXmlTag() |
224 |
{ |
225 |
_xmlTagList.removeAllElements(); |
226 |
} //-- void removeAllXmlTag()
|
227 |
|
228 |
/**
|
229 |
* Method removeXmlTag
|
230 |
*
|
231 |
* @param index
|
232 |
*/
|
233 |
public org.gvsig.utils.xmlEntity.generate.XmlTag removeXmlTag(int index) |
234 |
{ |
235 |
java.lang.Object obj = _xmlTagList.elementAt(index); |
236 |
_xmlTagList.removeElementAt(index); |
237 |
return (org.gvsig.utils.xmlEntity.generate.XmlTag) obj;
|
238 |
} //-- com.iver.utiles.xmlEntity.generate.XmlTag removeXmlTag(int)
|
239 |
|
240 |
/**
|
241 |
* Method setXmlTag
|
242 |
*
|
243 |
* @param index
|
244 |
* @param vXmlTag
|
245 |
*/
|
246 |
public void setXmlTag(int index, org.gvsig.utils.xmlEntity.generate.XmlTag vXmlTag) |
247 |
throws java.lang.IndexOutOfBoundsException
|
248 |
{ |
249 |
//-- check bounds for index
|
250 |
if ((index < 0) || (index > _xmlTagList.size())) { |
251 |
throw new IndexOutOfBoundsException(); |
252 |
} |
253 |
_xmlTagList.setElementAt(vXmlTag, index); |
254 |
} //-- void setXmlTag(int, com.iver.utiles.xmlEntity.generate.XmlTag)
|
255 |
|
256 |
/**
|
257 |
* Method setXmlTag
|
258 |
*
|
259 |
* @param xmlTagArray
|
260 |
*/
|
261 |
public void setXmlTag(org.gvsig.utils.xmlEntity.generate.XmlTag[] xmlTagArray) |
262 |
{ |
263 |
//-- copy array
|
264 |
_xmlTagList.removeAllElements(); |
265 |
for (int i = 0; i < xmlTagArray.length; i++) { |
266 |
_xmlTagList.addElement(xmlTagArray[i]); |
267 |
} |
268 |
} //-- void setXmlTag(com.iver.utiles.xmlEntity.generate.XmlTag)
|
269 |
|
270 |
/**
|
271 |
* Method unmarshal
|
272 |
*
|
273 |
* @param reader
|
274 |
*/
|
275 |
public static java.lang.Object unmarshal(java.io.Reader reader) |
276 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
277 |
{ |
278 |
return (org.gvsig.utils.xmlEntity.generate.XmlCastor) Unmarshaller.unmarshal(org.gvsig.utils.xmlEntity.generate.XmlCastor.class, reader);
|
279 |
} //-- java.lang.Object unmarshal(java.io.Reader)
|
280 |
|
281 |
/**
|
282 |
* Method validate
|
283 |
*/
|
284 |
public void validate() |
285 |
throws org.exolab.castor.xml.ValidationException
|
286 |
{ |
287 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
|
288 |
validator.validate(this);
|
289 |
} //-- void validate()
|
290 |
|
291 |
} |