Revision 9584 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/gml/FMAPGeometryFactory.java

View differences:

FMAPGeometryFactory.java
68 68
 *
69 69
 * $Id$
70 70
 * $Log$
71
 * Revision 1.3  2006-12-29 17:12:10  jorpiell
71
 * Revision 1.4  2007-01-08 12:12:03  csanchez
72
 * Corregida visualizaciĆ³n de Tablas simples
73
 *
74
 * Revision 1.3  2006/12/29 17:12:10  jorpiell
72 75
 * Se tienen en cuenta los simpleTypes y los choices, adem?s de los atributos multiples
73 76
 *
74 77
 * Revision 1.2  2006/10/10 12:55:27  jorpiell
......
124 127
		while(it.hasNext()){
125 128
			String key = (String)it.next();
126 129
			Object obj = values.get(key);
130
			/**************	
131
		   	 * <MULTIPLE> * 
132
		   	 **************/	
127 133
			if (obj instanceof ArrayList){
128 134
				returnValues[i] = getMultipleValue(key,(ArrayList)obj);
129
			}else if(obj instanceof LinkedHashMap){
135
			}
136
			/*************	
137
		   	 * <COMPLEX> *  
138
		   	 *************/	
139
			else if(obj instanceof LinkedHashMap){
130 140
				returnValues[i]  = getComplexValue(key,(LinkedHashMap)obj);
131
			}else{
141
			}
142
			/************	
143
		   	 * <SIMPLE> *  
144
		   	 ************/
145
			else{
132 146
				returnValues[i] = getValue(obj);
133 147
			}	
134 148
			i++;
......
155 169
	}
156 170
	
157 171
	private Value getMultipleValue(String name,ArrayList al){
158
		ComplexValue value = ValueFactory.createComplexValue(name);
159
		for (int i=0 ; i<al.size() ; i++){
160
			String attName = name + "_" + i;
161
			Object obj = al.get(i);
162
			if (obj instanceof ArrayList){
163
				value.put(attName,getMultipleValue(attName,(ArrayList)obj));
164
			}else if(obj instanceof LinkedHashMap){
165
				value.put(attName,getComplexValue(attName,(LinkedHashMap)obj));
166
			}else{
167
				value.put(attName,getValue(obj));
172
		if (al.size()==0){
173
			return null;
174
		}
175
		else if ((al.size()==1)&&(!((al.get(0) instanceof ArrayList)||(al.get(0) instanceof LinkedHashMap)))){
176
			return getValue(al.get(0));
177
		}
178
		else{
179
			ComplexValue value = ValueFactory.createComplexValue(name);
180
			for (int i=0 ; i<al.size() ; i++){
181
				String attName = name + "_" + i;
182
				Object obj = al.get(i);
183
				/**************	
184
			   	 * <MULTIPLE> * 
185
			   	 **************/	
186
				if (obj instanceof ArrayList){
187
					value.put(attName,getMultipleValue(attName,(ArrayList)obj));
188
				}
189
				/*************	
190
			   	 * <COMPLEX> *  
191
			   	 *************/	
192
				else if(obj instanceof LinkedHashMap){
193
					value.put(attName,getComplexValue(attName,(LinkedHashMap)obj));
194
				}
195
				/************	
196
			   	 * <SIMPLE> *  
197
			   	 ************/	
198
				else{
199
					value.put(attName,getValue(obj));
200
				}
168 201
			}
202
			return value;
169 203
		}
170
		return value;
171 204
	}
172 205
	
173 206
	/**

Also available in: Unified diff