public final FieldTextInfo createFieldInfo ( @ NotNull final Field field , @ NotNull final Locale locale , @ NotNull final Class < ? extends Annotation > annotationClasz ) { Contract . requireArgNotNull ( "field" , field ) ; Contract . requireArgNotNull ( "locale" , locale ) ; Contract . requireArgNotNull ( "annotationClasz" , annotationClasz ) ; final Annotation annotation = field . getAnnotation ( annotationClasz ) ; if ( annotation == null ) { return null ; } try { final ResourceBundle bundle = getResourceBundle ( annotation , locale , field . getDeclaringClass ( ) ) ; final String text = getText ( bundle , annotation , field . getName ( ) + "." + annotationClasz . getSimpleName ( ) ) ; return new FieldTextInfo ( field , text ) ; } catch ( final MissingResourceException ex ) { return new FieldTextInfo ( field , toNullableString ( getValue ( annotation ) ) ) ; } }
Returns the text information for a given field of a class .