// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.fasterxml.jackson.databind; import com.fasterxml.jackson.core.FormatSchema; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonStreamContext; import com.fasterxml.jackson.core.JsonToken; import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; // Referenced classes of package com.fasterxml.jackson.databind: // RuntimeJsonMappingException, JsonMappingException, JsonDeserializer, DeserializationContext, // JavaType public class MappingIterator implements Iterator, Closeable { protected static final MappingIterator EMPTY_ITERATOR = new MappingIterator(null, null, null, null, false, null); protected static final int STATE_CLOSED = 0; protected static final int STATE_HAS_VALUE = 3; protected static final int STATE_MAY_HAVE_VALUE = 2; protected static final int STATE_NEED_RESYNC = 1; protected final boolean _closeParser; protected final DeserializationContext _context; protected final JsonDeserializer _deserializer; protected final JsonParser _parser; protected final JsonStreamContext _seqContext; protected int _state; protected final JavaType _type; protected final Object _updatedValue; protected MappingIterator(JavaType javatype, JsonParser jsonparser, DeserializationContext deserializationcontext, JsonDeserializer jsondeserializer, boolean flag, Object obj) { _type = javatype; _parser = jsonparser; _context = deserializationcontext; _deserializer = jsondeserializer; _closeParser = flag; if (obj == null) { _updatedValue = null; } else { _updatedValue = obj; } if (jsonparser == null) { _seqContext = null; _state = 0; return; } deserializationcontext = jsonparser.getParsingContext(); if (!flag || !jsonparser.isExpectedStartArrayToken()) goto _L2; else goto _L1 _L1: jsonparser.clearCurrentToken(); javatype = deserializationcontext; _L4: _seqContext = javatype; _state = 2; return; _L2: jsonparser = jsonparser.getCurrentToken(); if (jsonparser != JsonToken.START_OBJECT) { javatype = deserializationcontext; if (jsonparser != JsonToken.START_ARRAY) { continue; /* Loop/switch isn't completed */ } } javatype = deserializationcontext.getParent(); if (true) goto _L4; else goto _L3 _L3: } protected static MappingIterator emptyIterator() { return EMPTY_ITERATOR; } protected Object _handleIOException(IOException ioexception) { throw new RuntimeException(ioexception.getMessage(), ioexception); } protected Object _handleMappingException(JsonMappingException jsonmappingexception) { throw new RuntimeJsonMappingException(jsonmappingexception.getMessage(), jsonmappingexception); } protected void _resync() throws IOException { JsonParser jsonparser = _parser; if (jsonparser.getParsingContext() == _seqContext) { return; } JsonToken jsontoken; do { while ((jsontoken = jsonparser.nextToken()) != JsonToken.END_ARRAY && jsontoken != JsonToken.END_OBJECT) { if (jsontoken == JsonToken.START_ARRAY || jsontoken == JsonToken.START_OBJECT) { jsonparser.skipChildren(); } else if (jsontoken == null) { return; } } } while (jsonparser.getParsingContext() != _seqContext); jsonparser.clearCurrentToken(); } protected Object _throwNoSuchElement() { throw new NoSuchElementException(); } public void close() throws IOException { if (_state != 0) { _state = 0; if (_parser != null) { _parser.close(); } } } public JsonLocation getCurrentLocation() { return _parser.getCurrentLocation(); } public JsonParser getParser() { return _parser; } public FormatSchema getParserSchema() { return _parser.getSchema(); } public boolean hasNext() { boolean flag; try { flag = hasNextValue(); } catch (JsonMappingException jsonmappingexception) { return ((Boolean)_handleMappingException(jsonmappingexception)).booleanValue(); } catch (IOException ioexception) { return ((Boolean)_handleIOException(ioexception)).booleanValue(); } return flag; } public boolean hasNextValue() throws IOException { boolean flag; boolean flag1; flag1 = false; flag = flag1; _state; JVM INSTR tableswitch 0 2: default 36 // 0 38 // 1 40 // 2 44; goto _L1 _L2 _L3 _L4 _L2: break MISSING_BLOCK_LABEL_38; _L1: flag = true; _L6: return flag; _L3: _resync(); _L4: if (_parser.getCurrentToken() != null) { break; /* Loop/switch isn't completed */ } JsonToken jsontoken = _parser.nextToken(); if (jsontoken != null && jsontoken != JsonToken.END_ARRAY) { break; /* Loop/switch isn't completed */ } _state = 0; flag = flag1; if (_closeParser) { flag = flag1; if (_parser != null) { _parser.close(); return false; } } if (true) goto _L6; else goto _L5 _L5: _state = 3; return true; } public Object next() { Object obj; try { obj = nextValue(); } catch (JsonMappingException jsonmappingexception) { throw new RuntimeJsonMappingException(jsonmappingexception.getMessage(), jsonmappingexception); } catch (IOException ioexception) { throw new RuntimeException(ioexception.getMessage(), ioexception); } return obj; } public Object nextValue() throws IOException { _state; JVM INSTR tableswitch 0 2: default 32 // 0 69 // 1 74 // 2 74; goto _L1 _L2 _L3 _L3 _L1: if (_updatedValue != null) goto _L5; else goto _L4 _L4: Object obj = _deserializer.deserialize(_parser, _context); _L7: _state = 2; _parser.clearCurrentToken(); return obj; _L2: return _throwNoSuchElement(); _L3: if (hasNextValue()) goto _L1; else goto _L6 _L6: return _throwNoSuchElement(); _L5: _deserializer.deserialize(_parser, _context, _updatedValue); obj = _updatedValue; goto _L7 Exception exception; exception; _state = 1; _parser.clearCurrentToken(); throw exception; } public Collection readAll(Collection collection) throws IOException { for (; hasNextValue(); collection.add(nextValue())) { } return collection; } public List readAll() throws IOException { return readAll(((List) (new ArrayList()))); } public List readAll(List list) throws IOException { for (; hasNextValue(); list.add(nextValue())) { } return list; } public void remove() { throw new UnsupportedOperationException(); } }