Revision 596 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/castor/ProjectElement.java

View differences:

ProjectElement.java
1 1
package com.iver.cit.gvsig.project.castor;
2 2

  
3
import java.beans.PropertyChangeListener;
4
import java.beans.PropertyChangeSupport;
5
import java.io.Serializable;
6
import java.text.DateFormat;
7
import java.util.Date;
8

  
3 9
import com.hardcode.driverManager.DriverLoadException;
4 10
import com.hardcode.gdbms.engine.data.DriverException;
11
import com.iver.andami.messages.NotificationManager;
5 12
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
6 13
import com.iver.cit.gvsig.fmap.layers.CancelationException;
7 14
import com.iver.cit.gvsig.fmap.layers.DifferentVersionException;
8 15
import com.iver.cit.gvsig.fmap.layers.XMLException;
9
import com.iver.mdiApp.App;
10

  
11 16
import com.iver.utiles.XMLEntity;
12 17

  
13
import java.beans.PropertyChangeListener;
14
import java.beans.PropertyChangeSupport;
15 18

  
16
import java.io.Serializable;
17

  
18
import java.text.DateFormat;
19

  
20
import java.util.Date;
21

  
22

  
23 19
/**
24 20
 * Clase base de los elementos del proyecto (mapas, tablas y vistas)
25 21
 *
......
170 166
    public static ProjectElement createFromXML(XMLEntity xml, Project p) throws XMLException{
171 167
        ProjectElement pe = null;
172 168

  
173
        try {
174
            Class clase = Class.forName(xml.getStringProperty("nameClass"));
175
            pe = (ProjectElement) clase.newInstance();
176
        } catch (Exception e) {
177
            App.instance.getNm().addError("Clase de ProjectElement no reconocida",
178
                e);
179
        }
169
            Class clase;
170
			try {
171
				clase = Class.forName(xml.getStringProperty("nameClass"));
172
			pe = (ProjectElement) clase.newInstance();
173
			} catch (ClassNotFoundException e) {
174
	            NotificationManager.addError("Clase de ProjectElement no reconocida",
175
	                    e);
176
			} catch (InstantiationException e) {
177
	            NotificationManager.addError("Clase de ProjectElement no reconocida",
178
	                    e);
179
			} catch (IllegalAccessException e) {
180
	            NotificationManager.addError("Clase de ProjectElement no reconocida",
181
	                    e);
182
			}
180 183

  
181 184
        pe.setComment(xml.getStringProperty("comment"));
182 185
        pe.setCreationDate(xml.getStringProperty("creationDate"));

Also available in: Unified diff