org.elasticsearch.hadoop.serialization.json.BackportedJacksonMappingIterator Maven / Gradle / Ivy
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you 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.elasticsearch.hadoop.serialization.json;
/*
* This file contains code from org.codehaus.jackson.map.MappingIterator.
* All copyrights apply.
* Persuant to section 4 of the Apache 2.0 License, the license for
* the file follows:
*/
/*
* 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.
*/
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.JsonParser;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.JsonStreamContext;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.JsonToken;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.map.DeserializationContext;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.map.JsonDeserializer;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.map.JsonMappingException;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.map.ObjectMapper;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.map.RuntimeJsonMappingException;
import org.elasticsearch.hadoop.thirdparty.codehaus.jackson.type.JavaType;
import java.io.IOException;
import java.util.Iterator;
/**
* Backported class from Jackson 1.8.8 for Jackson 1.5.2
*
* Iterator exposed by {@link ObjectMapper} when binding sequence of
* objects. Extension is done to allow more convenient exposing of
* {@link IOException} (which basic {@link Iterator} does not expose)
*
* @since 1.8
*/
class BackportedJacksonMappingIterator implements Iterator {
protected final static BackportedJacksonMappingIterator EMPTY_ITERATOR = new BackportedJacksonMappingIterator