package placebooks.model.json;

import java.io.IOException;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;

public class GeometryJSONDeserializer extends JsonDeserializer<Geometry>
{
	@Override
	public Geometry deserialize(final JsonParser parser, final DeserializationContext context) throws IOException,
			JsonProcessingException
	{
		try
		{
			return new WKTReader().read(parser.getText());
		}
		catch (final ParseException e)
		{
			throw new IOException("Parse Error", e);
		}
	}
}

@@ -52,16 +52,81 @@
 ception;
+%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;
 %0A%0Aimport
@@ -368,57 +368,8 @@
 ry;%0A
-import com.vividsolutions.jts.io.ParseException;%0A
 impo
@@ -484,16 +484,109 @@
 etry%3E%0A%7B%0A
+%09private final Logger logger = Logger.getLogger(GeometryJSONDeserializer.class.getName());%0A%09%0A
 %09@Overri
@@ -809,21 +809,16 @@
  (final 
-Parse
 Exceptio
@@ -833,47 +833,67 @@
 %0A%09%09%09
-throw new IOException(%22Parse Error%22, e)
+logger.log(Level.SEVERE, e.getMessage(), e);%0A%09%09%09return null
 ;%0A%09%09

Use null geometry if parsing geometry fails