public < T > T read ( Class < T > type , Class elementType ) throws YamlException { try { while ( true ) { Event event = parser . getNextEvent ( ) ; if ( event == null ) return null ; if ( event . type == STREAM_END ) return null ; if ( event . type == DOCUMENT_START ) break ; } return ( T ) readValue ( type , elementType , null ) ; } catch ( ParserException ex ) { throw new YamlException ( "Error parsing YAML." , ex ) ; } catch ( TokenizerException ex ) { throw new YamlException ( "Error tokenizing YAML." , ex ) ; } }
Reads an array Map List or Collection object of the specified type from YAML using the specified element type .