public void calcFillSettings ( String field , Map < String , Object > attributes ) { String capitalizedFieldName = StringUtils . capitalize ( field ) ; String methodName = "doFill" + capitalizedFieldName + "Items" ; Method method = ReflectionUtils . getPublicMethodNamed ( getClass ( ) , methodName ) ; if ( method == null ) throw new IllegalStateException ( String . format ( "%s doesn't have the %s method for filling a drop-down list" , getClass ( ) , methodName ) ) ; // build query parameter line by figuring out what should be submitted List < String > depends = buildFillDependencies ( method , new ArrayList <> ( ) ) ; if ( ! depends . isEmpty ( ) ) attributes . put ( "fillDependsOn" , Util . join ( depends , " " ) ) ; attributes . put ( "fillUrl" , String . format ( "%s/%s/fill%sItems" , getCurrentDescriptorByNameUrl ( ) , getDescriptorUrl ( ) , capitalizedFieldName ) ) ; }
Computes the list of other form fields that the given field depends on via the doFillXyzItems method and sets that as the fillDependsOn attribute . Also computes the URL of the doFillXyzItems and sets that as the fillUrl attribute .