Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/AbstractCadMemoryDriver.java

View differences:

AbstractCadMemoryDriver.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.2  2007-01-12 19:16:09  azabala
48
* Revision 1.3  2007-03-06 17:08:54  caballero
49
* Exceptions
50
*
51
* Revision 1.2  2007/01/12 19:16:09  azabala
49 52
* Added getCadSource(int) method
50 53
*
51 54
* Revision 1.1  2006/10/26 17:05:30  azabala
......
57 60

  
58 61
import java.sql.Types;
59 62

  
60
import com.hardcode.gdbms.engine.data.driver.DriverException;
63
import com.hardcode.gdbms.driver.exceptions.BadFieldDriverException;
64
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
61 65

  
62 66
/**
63 67
 * Abstract base class for CAD drivers (dxf, dwg) memory drivers.
64
 * 
68
 *
65 69
 * Features readed with these drivers share the same schema
66 70
 * (static FieldDescription[])
67
 * 
71
 *
68 72
 * @author azabala
69
 * 
73
 *
70 74
 * */
71 75
public abstract class AbstractCadMemoryDriver extends MemoryDriver {
72
	
76

  
73 77
	protected final static int ID_FIELD_ID = 0;
74 78

  
75 79
	protected final static int ID_FIELD_FSHAPE = 1;
......
163 167
		fields[9] = fieldDesc;
164 168

  
165 169
	}
166
	
170

  
167 171
	/**
168 172
	 * Returns de field type of the specified field index.
169 173
	 * @return field type of i field
170 174
	 */
171
	public int getFieldType(int i) throws DriverException {
175
	public int getFieldType(int i) throws ReadDriverException {
172 176
	  //azabala: we overwrite MemoryDriver because type resolution
173 177
	  //is based in first register value (it could be null)
174 178
      if(i >= fields.length)
175
    	  throw new DriverException("Excedido el numero de campos del dxf");
179
    	  throw new BadFieldDriverException(getName(),null,String.valueOf(i));
176 180
      return fields[i].getFieldType();
177 181
	}
178
	
182

  
179 183
	/**
180 184
	 * Any feature of this kind of driver will be associated to a
181 185
	 * cad drawing entity.
182 186
	 * This method will return this drawing entity
183
	 * 
187
	 *
184 188
	 * @param index position of the drawing entity
185
	 * 
186
	 * 
189
	 *
190
	 *
187 191
	 * */
188 192
	public abstract Object getCadSource(int index);
189
	
190
	
193

  
194

  
191 195
}
192 196

  

Also available in: Unified diff