Revision 44307 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/spi/AbstractDataParameters.java
AbstractDataParameters.java | ||
---|---|---|
102 | 102 |
manager.clear(this); |
103 | 103 |
} |
104 | 104 |
|
105 |
protected void copyValuesTo(AbstractDataParameters target) {
|
|
105 |
protected void copyValuesTo(DataParameters target) { |
|
106 | 106 |
DynObjectManager manager = ToolsLocator.getDynObjectManager(); |
107 | 107 |
manager.copy(this, target); |
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
@Override |
111 | 111 |
public DataParameters getCopy() { |
112 |
// TODO Delegar en el DynObject cuando tenga este servicio |
|
113 |
AbstractDataParameters copy; |
|
112 |
DataParameters copy; |
|
114 | 113 |
try { |
115 |
copy = (AbstractDataParameters) this.getClass().newInstance(); |
|
116 |
} catch (InstantiationException | IllegalAccessException e) { |
|
114 |
if( this instanceof Cloneable ) { |
|
115 |
copy = (DataParameters) this.clone(); |
|
116 |
} else { |
|
117 |
copy = (DataParameters) this.getClass().newInstance(); |
|
118 |
this.copyValuesTo(copy); |
|
119 |
} |
|
120 |
} catch (Exception e) { |
|
117 | 121 |
throw new CopyParametersException("data parameters", e); |
118 | 122 |
} |
119 |
this.copyValuesTo(copy); |
|
120 | 123 |
return copy; |
121 | 124 |
} |
122 | 125 |
|
Also available in: Unified diff