protected FieldDescriptor findField ( final String fieldName ) { FieldDescriptor fieldDescriptor = classDescriptor . getFieldDescriptor ( fieldName , true ) ; if ( fieldDescriptor != null ) { return fieldDescriptor ; } // field descriptor not found in this class // try to locate it in the superclasses Class [ ] superclasses = classDescriptor . getAllSuperclasses ( ) ; for ( Class superclass : superclasses ) { ClassDescriptor classDescriptor = ClassIntrospector . get ( ) . lookup ( superclass ) ; fieldDescriptor = classDescriptor . getFieldDescriptor ( fieldName , true ) ; if ( fieldDescriptor != null ) { return fieldDescriptor ; } } // nothing found return null ; }
Locates property field . Field is being searched also in all superclasses of current class .