Statistics
| Revision:

root / trunk / libraries / libRemoteServices / src / org / gvsig / remoteClient / gml / schemas / XMLComplexType.java @ 8017

History | View | Annotate | Download (3.26 KB)

1
package org.gvsig.remoteClient.gml.schemas;
2

    
3
import java.util.Iterator;
4
import java.util.LinkedHashMap;
5
import java.util.Map;
6
import java.util.Set;
7
import java.util.Vector;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: XMLComplexType.java 8017 2006-10-10 12:52:28Z jorpiell $
52
 * $Log$
53
 * Revision 1.5  2006-10-10 12:52:28  jorpiell
54
 * Soporte para features complejas.
55
 *
56
 * Revision 1.4  2006/10/02 08:33:49  jorpiell
57
 * Cambios del 10 copiados al head
58
 *
59
 * Revision 1.2.2.1  2006/09/19 12:23:15  jorpiell
60
 * Ya no se depende de geotools
61
 *
62
 * Revision 1.3  2006/09/18 12:08:55  jorpiell
63
 * Se han hecho algunas modificaciones que necesitaba el WFS
64
 *
65
 * Revision 1.2  2006/08/29 08:43:13  jorpiell
66
 * Dos peque?os cambios para tener en cuenta las referencias
67
 *
68
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
69
 * Primer commit del driver de Gml
70
 *
71
 *
72
 */
73
/**
74
 * This class implements an XSD complex type
75
 * 
76
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
77
 */
78
public class XMLComplexType implements IXMLType {
79
        private String type = null;
80
        private LinkedHashMap attributes = null;
81
                        
82
        public XMLComplexType(String type) {
83
                super();
84
                this.type = type;
85
                attributes = new LinkedHashMap();
86
        }
87
        
88
        /*
89
         *  (non-Javadoc)
90
         * @see org.gvsig.remoteClient.gml.schemas.IXMLType#getType()
91
         */
92
        public int getType() {
93
                return IXMLType.COMPLEX;
94
        }
95
        
96
        /*
97
         *  (non-Javadoc)
98
         * @see org.gvsig.remoteClient.gml.schemas.IXMLType#getName()
99
         */
100
        public String getName() {
101
                return type;
102
        }
103
        
104
        /**
105
         * @return Returns the subtypes.
106
         */
107
        public Map getSubtypes() {
108
                return attributes;
109
        }
110
        
111
        /**
112
         * @param subtypes The subtypes to set.
113
         */
114
        public void addSubtypes(XMLElement element) {
115
                if (element.getName() != null){
116
                        this.attributes.put(element.getName(),element);
117
                }
118
        }
119
        
120
        /**
121
         * 
122
         * @param name
123
         * @return
124
         */
125
        public XMLElement getAttribute(String name){
126
                return (XMLElement)attributes.get(name);
127
        }
128

    
129
        /**
130
         * @return Returns the vElements.
131
         */
132
        public Vector getAttributes() {
133
                Set keys = attributes.keySet();
134
                Iterator it = keys.iterator();
135
                Vector vector = new Vector();
136
                while(it.hasNext()){
137
                        vector.add(attributes.get((String)it.next()));
138
                }
139
                return vector;
140
        }
141
        
142
        
143
        
144
}