public final class ToArrayList<E> extends Object implements BSONParseListener
ArrayList
.ArrayList
,
ToArrayList
Constructor and Description |
---|
ToArrayList(BSONDecoder<E> decoder) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
returns false
|
static ToArrayList<Object> |
apply()
Creates a ToHashMap using a
ToJavaCollectionBSONDecoder decoder |
static <E> ToArrayList<E> |
apply(BSONDecoder<E> decoder) |
void |
ended()
Stops parsing, and prevents any further parsing events from happening until
started() is called again. |
ArrayList<E> |
getResult()
returns the generated HashMap
|
void |
newKeyValue(byte a,
String key,
DataInput c)
Parses a value of type typeOfValue from reader, treats that as a value, and then
does whatever with the key-value pair.
|
void |
started()
restarts the item count
|
public ToArrayList(BSONDecoder<E> decoder)
public static ToArrayList<Object> apply()
ToJavaCollectionBSONDecoder
decoderpublic static <E> ToArrayList<E> apply(BSONDecoder<E> decoder)
public void started() throws IllegalStateException
started
in interface BSONParseListener
IllegalStateException
- if #started is called twice between invocation of #endedpublic void ended()
started()
is called again.ended
in interface BSONParseListener
IllegalStateException
- if this cannot accept parse eventsParseException
public void newKeyValue(byte a, String key, DataInput c) throws NullPointerException, IOException, ParseException, UnsupportedOperationException
BSONParseListener
newKeyValue
in interface BSONParseListener
key
- the pair's keyc
- the input values, to obtain a value fromNullPointerException
IOException
ParseException
UnsupportedOperationException
public ArrayList<E> getResult()
public boolean abort() throws IllegalStateException
abort
in interface BSONParseListener
IllegalStateException
- never