public AsyncWork < Boolean , Exception > nextInnerElement ( ElementContext parent , String childName ) { AsyncWork < Boolean , Exception > next = nextInnerElement ( parent ) ; do { if ( next . isUnblocked ( ) ) { if ( next . hasError ( ) ) return next ; if ( ! next . getResult ( ) . booleanValue ( ) ) return next ; if ( event . text . equals ( childName ) ) return next ; next = nextInnerElement ( parent ) ; continue ; } break ; } while ( true ) ; AsyncWork < Boolean , Exception > result = new AsyncWork <> ( ) ; AsyncWork < Boolean , Exception > n = next ; next . listenInline ( ( ) -> { if ( n . hasError ( ) ) result . error ( n . getError ( ) ) ; else if ( ! n . getResult ( ) . booleanValue ( ) ) result . unblockSuccess ( Boolean . FALSE ) ; else if ( event . text . equals ( childName ) ) result . unblockSuccess ( Boolean . TRUE ) ; else new ParsingTask ( ( ) -> { nextInnerElement ( parent , childName ) . listenInline ( result ) ; } ) . start ( ) ; } , result ) ; return result ; }
Go to the next inner element having the given name . The result is false if the parent element has been closed .