private void visitMap ( final ObjectGraphNode node ) { Map map = ( Map ) node . getValue ( ) ; for ( Iterator i = map . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) i . next ( ) ; Object key = entry . getKey ( ) ; if ( key != null ) { ObjectGraphNode keyNode = new ObjectGraphNode ( ++ nodeCount , "key" , key . getClass ( ) . getName ( ) , key ) ; node . add ( keyNode ) ; visit ( keyNode ) ; } else { ObjectGraphNode keyNode = new ObjectGraphNode ( ++ nodeCount , "key" , Object . class . getName ( ) , null ) ; node . add ( keyNode ) ; } Object value = entry . getValue ( ) ; if ( value != null ) { ObjectGraphNode valueNode = new ObjectGraphNode ( ++ nodeCount , "value" , value . getClass ( ) . getName ( ) , value ) ; node . add ( valueNode ) ; visit ( valueNode ) ; } else { ObjectGraphNode valueNode = new ObjectGraphNode ( ++ nodeCount , "value" , Object . class . getName ( ) , null ) ; node . add ( valueNode ) ; } } adjustOverhead ( node ) ; }
Visits all the keys and entries of the given map .