protected Binder findBinderByPropertyName ( Class parentObjectType , String propertyName ) { PropertyNameKey key = new PropertyNameKey ( parentObjectType , propertyName ) ; Binder binder = ( Binder ) propertyNameBinders . get ( key ) ; if ( binder == null ) { // if no direct match was found try to find a match in any super classes final Map potentialMatchingBinders = new HashMap ( ) ; for ( Iterator i = propertyNameBinders . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) i . next ( ) ; if ( ( ( PropertyNameKey ) entry . getKey ( ) ) . getPropertyName ( ) . equals ( propertyName ) ) { potentialMatchingBinders . put ( ( ( PropertyNameKey ) entry . getKey ( ) ) . getParentObjectType ( ) , entry . getValue ( ) ) ; } } binder = ( Binder ) ClassUtils . getValueFromMapForClass ( parentObjectType , potentialMatchingBinders ) ; if ( binder != null ) { // remember the lookup so it doesn't have to be discovered again registerBinderForPropertyName ( parentObjectType , propertyName , binder ) ; } } return binder ; }
Try to find a binder for the provided parentObjectType and propertyName . If no direct match found try to find binder for any superclass of the provided objectType which also has the same propertyName .