protected Object readValue ( Class type , Class elementType , Class defaultType ) throws YamlException , ParserException , TokenizerException { String tag = null , anchor = null ; Event event = parser . peekNextEvent ( ) ; switch ( event . type ) { case ALIAS : parser . getNextEvent ( ) ; anchor = ( ( AliasEvent ) event ) . anchor ; Object value = anchors . get ( anchor ) ; if ( value == null ) throw new YamlReaderException ( "Unknown anchor: " + anchor ) ; return value ; case MAPPING_START : case SEQUENCE_START : tag = ( ( CollectionStartEvent ) event ) . tag ; anchor = ( ( CollectionStartEvent ) event ) . anchor ; break ; case SCALAR : tag = ( ( ScalarEvent ) event ) . tag ; anchor = ( ( ScalarEvent ) event ) . anchor ; break ; default : } return readValueInternal ( this . chooseType ( tag , defaultType , type ) , elementType , anchor ) ; }
Reads an object from the YAML . Can be overidden to take some action for any of the objects returned .