Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.framework / org.gvsig.andami / src / main / java / org / gvsig / andami / persistence / generate / XmlEntity.java @ 40596

History | View | Annotate | Download (7.34 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: XmlEntity.java 29593 2009-06-29 15:54:31Z jpiera $
29
 */
30

    
31
package org.gvsig.andami.persistence.generate;
32

    
33
  //---------------------------------/
34
 //- Imported classes and packages -/
35
//---------------------------------/
36

    
37
import java.util.Vector;
38

    
39
import org.exolab.castor.xml.Marshaller;
40
import org.exolab.castor.xml.Unmarshaller;
41

    
42
/**
43
 * Class XmlEntity.
44
 * 
45
 * @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (lun, 29 jun 2009) $
46
 */
47
public class XmlEntity implements java.io.Serializable {
48

    
49

    
50
      //--------------------------/
51
     //- Class/Member Variables -/
52
    //--------------------------/
53

    
54
    /**
55
     * Field _propertyList
56
     */
57
    private java.util.Vector _propertyList;
58

    
59

    
60
      //----------------/
61
     //- Constructors -/
62
    //----------------/
63

    
64
    public XmlEntity() {
65
        super();
66
        _propertyList = new Vector();
67
    } //-- com.iver.andami.persistence.generate.XmlEntity()
68

    
69

    
70
      //-----------/
71
     //- Methods -/
72
    //-----------/
73

    
74
    /**
75
     * Method addProperty
76
     * 
77
     * @param vProperty
78
     */
79
    public void addProperty(org.gvsig.andami.persistence.generate.Property vProperty)
80
        throws java.lang.IndexOutOfBoundsException
81
    {
82
        _propertyList.addElement(vProperty);
83
    } //-- void addProperty(com.iver.andami.persistence.generate.Property) 
84

    
85
    /**
86
     * Method addProperty
87
     * 
88
     * @param index
89
     * @param vProperty
90
     */
91
    public void addProperty(int index, org.gvsig.andami.persistence.generate.Property vProperty)
92
        throws java.lang.IndexOutOfBoundsException
93
    {
94
        _propertyList.insertElementAt(vProperty, index);
95
    } //-- void addProperty(int, com.iver.andami.persistence.generate.Property) 
96

    
97
    /**
98
     * Method enumerateProperty
99
     */
100
    public java.util.Enumeration enumerateProperty()
101
    {
102
        return _propertyList.elements();
103
    } //-- java.util.Enumeration enumerateProperty() 
104

    
105
    /**
106
     * Method getProperty
107
     * 
108
     * @param index
109
     */
110
    public org.gvsig.andami.persistence.generate.Property getProperty(int index)
111
        throws java.lang.IndexOutOfBoundsException
112
    {
113
        //-- check bounds for index
114
        if ((index < 0) || (index > _propertyList.size())) {
115
            throw new IndexOutOfBoundsException();
116
        }
117
        
118
        return (org.gvsig.andami.persistence.generate.Property) _propertyList.elementAt(index);
119
    } //-- com.iver.andami.persistence.generate.Property getProperty(int) 
120

    
121
    /**
122
     * Method getProperty
123
     */
124
    public org.gvsig.andami.persistence.generate.Property[] getProperty()
125
    {
126
        int size = _propertyList.size();
127
        org.gvsig.andami.persistence.generate.Property[] mArray = new org.gvsig.andami.persistence.generate.Property[size];
128
        for (int index = 0; index < size; index++) {
129
            mArray[index] = (org.gvsig.andami.persistence.generate.Property) _propertyList.elementAt(index);
130
        }
131
        return mArray;
132
    } //-- com.iver.andami.persistence.generate.Property[] getProperty() 
133

    
134
    /**
135
     * Method getPropertyCount
136
     */
137
    public int getPropertyCount()
138
    {
139
        return _propertyList.size();
140
    } //-- int getPropertyCount() 
141

    
142
    /**
143
     * Method isValid
144
     */
145
    public boolean isValid()
146
    {
147
        try {
148
            validate();
149
        }
150
        catch (org.exolab.castor.xml.ValidationException vex) {
151
            return false;
152
        }
153
        return true;
154
    } //-- boolean isValid() 
155

    
156
    /**
157
     * Method marshal
158
     * 
159
     * @param out
160
     */
161
    public void marshal(java.io.Writer out)
162
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
163
    {
164
        
165
        Marshaller.marshal(this, out);
166
    } //-- void marshal(java.io.Writer) 
167

    
168
    /**
169
     * Method marshal
170
     * 
171
     * @param handler
172
     */
173
    public void marshal(org.xml.sax.ContentHandler handler)
174
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
175
    {
176
        
177
        Marshaller.marshal(this, handler);
178
    } //-- void marshal(org.xml.sax.ContentHandler) 
179

    
180
    /**
181
     * Method removeAllProperty
182
     */
183
    public void removeAllProperty()
184
    {
185
        _propertyList.removeAllElements();
186
    } //-- void removeAllProperty() 
187

    
188
    /**
189
     * Method removeProperty
190
     * 
191
     * @param index
192
     */
193
    public org.gvsig.andami.persistence.generate.Property removeProperty(int index)
194
    {
195
        java.lang.Object obj = _propertyList.elementAt(index);
196
        _propertyList.removeElementAt(index);
197
        return (org.gvsig.andami.persistence.generate.Property) obj;
198
    } //-- com.iver.andami.persistence.generate.Property removeProperty(int) 
199

    
200
    /**
201
     * Method setProperty
202
     * 
203
     * @param index
204
     * @param vProperty
205
     */
206
    public void setProperty(int index, org.gvsig.andami.persistence.generate.Property vProperty)
207
        throws java.lang.IndexOutOfBoundsException
208
    {
209
        //-- check bounds for index
210
        if ((index < 0) || (index > _propertyList.size())) {
211
            throw new IndexOutOfBoundsException();
212
        }
213
        _propertyList.setElementAt(vProperty, index);
214
    } //-- void setProperty(int, com.iver.andami.persistence.generate.Property) 
215

    
216
    /**
217
     * Method setProperty
218
     * 
219
     * @param propertyArray
220
     */
221
    public void setProperty(org.gvsig.andami.persistence.generate.Property[] propertyArray)
222
    {
223
        //-- copy array
224
        _propertyList.removeAllElements();
225
        for (int i = 0; i < propertyArray.length; i++) {
226
            _propertyList.addElement(propertyArray[i]);
227
        }
228
    } //-- void setProperty(com.iver.andami.persistence.generate.Property) 
229

    
230
    /**
231
     * Method unmarshal
232
     * 
233
     * @param reader
234
     */
235
    public static java.lang.Object unmarshal(java.io.Reader reader)
236
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
237
    {
238
        return (org.gvsig.andami.persistence.generate.XmlEntity) Unmarshaller.unmarshal(org.gvsig.andami.persistence.generate.XmlEntity.class, reader);
239
    } //-- java.lang.Object unmarshal(java.io.Reader) 
240

    
241
    /**
242
     * Method validate
243
     */
244
    public void validate()
245
        throws org.exolab.castor.xml.ValidationException
246
    {
247
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
248
        validator.validate(this);
249
    } //-- void validate() 
250

    
251
}