![JAR search and dependency download from the Maven repository](/logo.png)
org.loom.appengine.json.CursorDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of loom-appengine Show documentation
Show all versions of loom-appengine Show documentation
Uploads all artifacts belonging to configuration ':archives'.
The newest version!
package org.loom.appengine.json;
import java.io.IOException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import com.google.appengine.api.datastore.Cursor;
public class CursorDeserializer extends JsonDeserializer {
@Override
public Cursor deserialize(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException {
JsonToken curr = jp.getCurrentToken();
// Usually should just get string value:
if (curr == JsonToken.VALUE_STRING || curr.isScalarValue()) {
return Cursor.fromWebSafeString(jp.getText());
}
throw ctxt.mappingException(Cursor.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy