public ResourceBundle getRecordResource ( Class < ? > classResource , Locale locale ) { ClassLoader classLoader = this . getClass ( ) . getClassLoader ( ) ; ResourceBundle resourceBundle = null ; String typicalResourceClassName = null ; try { typicalResourceClassName = Util . convertClassName ( classResource . getName ( ) , Constants . RES_SUBPACKAGE , 2 ) + "Resources" ; resourceBundle = ClassServiceUtility . getClassService ( ) . getResourceBundle ( typicalResourceClassName , locale , null , classLoader ) ; } catch ( MissingResourceException ex ) { resourceBundle = null ; } int i = - 1 ; while ( resourceBundle == null ) { String resourceClassName = Util . convertClassName ( classResource . getName ( ) , Constants . RES_SUBPACKAGE , i ) ; if ( resourceClassName == null ) return null ; if ( resourceClassName . equals ( typicalResourceClassName ) ) return null ; // Looked through them all resourceClassName = resourceClassName + "Resources" ; try { resourceBundle = ClassServiceUtility . getClassService ( ) . getResourceBundle ( resourceClassName , locale , null , classLoader ) ; } catch ( MissingResourceException ex ) { resourceBundle = null ; } i -- ; } return resourceBundle ; }
Get the record resource bundle .