public static Character parserCharacter ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_STRING ) { String str = parser . getValueString ( ) ; if ( str . length ( ) != 1 ) { throw new IllegalStateException ( "unexpected value. expecte string size is 1. but get=" + str ) ; } return str . charAt ( 0 ) ; } else { throw new IllegalStateException ( "unexpected state. expected=VALUE_STRING, but get=" + eventType . toString ( ) ) ; } }
Parses the current token as a character .