public static List < Boolean > parserBooleanList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!" ) ; } List < Boolean > list = new ArrayList < Boolean > ( ) ; while ( parser . lookAhead ( ) != State . END_ARRAY ) { eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { list . add ( null ) ; } else if ( eventType == State . VALUE_BOOLEAN ) { list . add ( parser . getValueBoolean ( ) ) ; } else { throw new IllegalStateException ( "unexpected state. expected=VALUE_BOOLEAN, but get=" + eventType . toString ( ) ) ; } } parser . getEventType ( ) ; return list ; }
Parses the current token as a list of booleans .