public String getString ( String strResource ) { String strResult = null ; if ( m_menuResourceBundle == null ) { m_menuResourceBundle = new ResourceBundle [ 10 ] ; Class < ? > classResource = this . getClass ( ) ; Locale locale = Locale . getDefault ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { m_menuResourceBundle [ i ] = null ; if ( classResource != null ) { // First time only m_menuResourceBundle [ i ] = this . getRecordResource ( classResource , locale ) ; classResource = classResource . getSuperclass ( ) ; if ( classResource != null ) if ( ( classResource . getName ( ) . equals ( Constants . ROOT_PACKAGE + "base.db.Record" ) ) || ( classResource . getName ( ) . equals ( FieldList . class . getName ( ) ) ) ) classResource = null ; // Stop at record class } } } for ( int i = 0 ; i < 10 ; i ++ ) { if ( m_menuResourceBundle [ i ] != null ) { strResult = null ; try { strResult = m_menuResourceBundle [ i ] . getString ( strResource ) ; } catch ( MissingResourceException ex ) { strResult = null ; } if ( ( strResult != null ) && ( strResult . length ( ) > 0 ) ) return strResult ; // Found, return value } } return strResource ; // Not found, return original key. }
Get the string that matches this key . This method traverses the class hierarchy for a matching string that matches this key value . If the resource bundle hasn t been read yet reads the bundle from the . res package .