com.dropbox.client2.jsonextract
Class JsonList

java.lang.Object
  extended by com.dropbox.client2.jsonextract.JsonList
All Implemented Interfaces:
Iterable<JsonThing>

public final class JsonList
extends Object
implements Iterable<JsonThing>

(Internal class for extracting JSON.) A JSON "array" (a list of arbitrary JSON values).


Nested Class Summary
static class JsonList.Extractor<T>
           
 
Field Summary
 T internal
           
 String path
           
 
Constructor Summary
JsonList(List<Object> internal)
           
JsonList(List<Object> internal, String path)
           
 
Method Summary
 JsonExtractionException error(String message)
           
 void expectLength(int length)
           
<T> ArrayList<T>
extract(JsonExtractor<T> elementExtractor)
           
 JsonThing get(int index)
           
 Iterator<JsonThing> iterator()
           
 int length()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internal

public final T internal

path

public final String path
Constructor Detail

JsonList

public JsonList(List<Object> internal,
                String path)

JsonList

public JsonList(List<Object> internal)
Method Detail

get

public JsonThing get(int index)
              throws JsonExtractionException
Throws:
JsonExtractionException

expectLength

public void expectLength(int length)
                  throws JsonExtractionException
Throws:
JsonExtractionException

length

public int length()

iterator

public Iterator<JsonThing> iterator()
Specified by:
iterator in interface Iterable<JsonThing>

extract

public <T> ArrayList<T> extract(JsonExtractor<T> elementExtractor)
                     throws JsonExtractionException
Throws:
JsonExtractionException

error

public JsonExtractionException error(String message)


Copyright © 2012. All Rights Reserved.