Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/type/impl/DefaultGeometryType.java
DefaultGeometryType.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.fmap.geom.type.impl; |
29 | 29 |
|
30 |
import java.lang.reflect.InvocationTargetException; |
|
30 | 31 |
import java.util.ArrayList; |
31 | 32 |
import java.util.List; |
32 | 33 |
|
... | ... | |
111 | 112 |
*/ |
112 | 113 |
public Geometry create() throws CreateGeometryException{ |
113 | 114 |
try { |
114 |
return (Geometry)geometryClass.newInstance(); |
|
115 |
} catch (InstantiationException e) { |
|
115 |
Class[] parameterTypes = {GeometryType.class}; |
|
116 |
Object[] parameters = {this}; |
|
117 |
return (Geometry)geometryClass.getConstructor(parameterTypes).newInstance(parameters); |
|
118 |
} catch (Exception e) { |
|
116 | 119 |
throw new CreateGeometryException(type, subType, e); |
117 |
} catch (IllegalAccessException e) { |
|
118 |
throw new CreateGeometryException(type, subType, e); |
|
119 |
} |
|
120 |
} |
|
120 | 121 |
} |
121 | 122 |
|
122 | 123 |
/** |
Also available in: Unified diff