@ Override public ValueAndDeclaredType traverse ( final Object toTraverse , final String type , final boolean onlyToParent , final String ... names ) { // Traverse through names (if any) if ( ( names == null ) || ( names . length == 0 ) ) { // If no names, no parent if ( onlyToParent ) { return new ValueAndDeclaredType ( null , null ) ; } return new ValueAndDeclaredType ( null , type ) ; } String traverseDeclaredType = type ; for ( int loop = 0 , length = names . length ; loop < length ; loop ++ ) { if ( onlyToParent && ( loop >= ( length - 1 ) ) ) { return new ValueAndDeclaredType ( null , traverseDeclaredType ) ; } String name = names [ loop ] ; Property property = getProperties ( traverseDeclaredType ) . get ( name ) ; if ( ( property == null ) || ! property . isReadable ( ) ) { return new ValueAndDeclaredType ( null , null ) ; } traverseDeclaredType = property . getType ( ) ; } return new ValueAndDeclaredType ( null , traverseDeclaredType ) ; }
Traverses the given Class heirarchy using properties of the given names .