Revision 8017 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/factories/XMLTypesFactory.java

View differences:

XMLTypesFactory.java
1 1
package org.gvsig.remoteClient.gml.factories;
2 2

  
3 3
import java.util.Hashtable;
4
import java.util.Iterator;
4 5
import java.util.Set;
5 6

  
6 7
import org.gvsig.remoteClient.gml.schemas.GMLGeometryType;
......
52 53
 *
53 54
 * $Id$
54 55
 * $Log$
55
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
56
 * Revision 1.4  2006-10-10 12:52:28  jorpiell
57
 * Soporte para features complejas.
58
 *
59
 * Revision 1.3  2006/10/02 08:33:49  jorpiell
56 60
 * Cambios del 10 copiados al head
57 61
 *
58 62
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
......
97 101
	 * @return
98 102
	 */
99 103
	public static IXMLType getType(String type){
100
		return (IXMLType)types.get(type.toUpperCase());
104
		IXMLType xmlType = (IXMLType)types.get(type.toUpperCase());
105
		if (xmlType == null){
106
			xmlType = getTypeWithOutNameSpace(type);
107
		}
108
		return xmlType;		
101 109
	}
102 110
	
103 111
	/**
112
	 * This method is used to solve some mistakes. It doesn't
113
	 * consider the namespace
114
	 * @param type
115
	 * @return
116
	 */
117
	public static IXMLType getTypeWithOutNameSpace(String type){
118
		Set keys = types.keySet();
119
		Iterator it = keys.iterator();
120
		while(it.hasNext()){
121
			String key = (String)it.next();
122
			String[] parts = key.split(":");
123
			if (parts.length > 1){
124
				if (parts[1].compareTo(type.toUpperCase())==0){
125
					return (IXMLType)types.get(key);
126
				}
127
			}
128
		}
129
		return null;
130
	}
131
	
132
	/**
104 133
	 * Adds a new type
105 134
	 * @param type
106 135
	 * type to add 
......
117 146
	 * Complex type name
118 147
	 * @return
119 148
	 */
120
	public static XMLComplexType addCompleyType(String nameSpace,String name){
149
	public static XMLComplexType addComplexType(String nameSpace,String name){
121 150
		XMLComplexType complexType = new XMLComplexType(nameSpace + ":" + name);
122 151
		addType(complexType);
123 152
		return complexType;

Also available in: Unified diff