private Siren4JSubEntity getSubEntityAnnotation ( Field currentField , List < ReflectedInfo > fieldInfo ) { Siren4JSubEntity result = null ; result = currentField . getAnnotation ( Siren4JSubEntity . class ) ; if ( result == null && fieldInfo != null ) { ReflectedInfo info = ReflectionUtils . getFieldInfoByName ( fieldInfo , currentField . getName ( ) ) ; if ( info != null && info . getGetter ( ) != null ) { result = info . getGetter ( ) . getAnnotation ( Siren4JSubEntity . class ) ; } } return result ; }
Helper to retrieve a sub entity annotation from either the field itself or the getter . If an annotation exists on both then the field wins .