org.tiogasolutions.dev.jackson.qry.QueryResultDeserializer Maven / Gradle / Ivy
/*
* Copyright 2014 Harlan Noonkester
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.tiogasolutions.dev.jackson.qry;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import org.tiogasolutions.dev.common.exceptions.ApiException;
import org.tiogasolutions.dev.domain.query.ListQueryResult;
import org.tiogasolutions.dev.domain.query.QueryResult;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* User: harlan
* Date: 7/21/12
* Time: 10:36 PM
*/
@SuppressWarnings("rawtypes")
public final class QueryResultDeserializer extends StdDeserializer {
private static final long serialVersionUID = 1L;
public QueryResultDeserializer() {
super(QueryResult.class);
}
@Override
public QueryResult deserialize(JsonParser parser, DeserializationContext context) throws IOException {
String containsTypeName = null;
Class> containsType = null;
Integer limit = null;
Integer offset = null;
Integer totalFound = null;
Boolean totalExact = null;
List