Class AuthResourceBundle

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  AuthResourceBundle.Content
      Defines the keys and value types required for a bundle of this class.
      • Nested classes/interfaces inherited from class java.util.ResourceBundle

        java.util.ResourceBundle.Control
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Logger logger_  
      private java.util.Hashtable map_  
      • Fields inherited from class java.util.ResourceBundle

        parent
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void checkHasAllKeys​(java.util.ResourceBundle bundle)
      Determines if a bundle has all the required keys for this class.
      static AuthResourceBundle.Content getAuthContent​(java.util.ResourceBundle bundle)
      Returns a Content object based on a bundle which has the keys that AuthResourceBundle is supposed to have.
      (package private) static java.lang.reflect.Method[] getContentMethods()
      Returns all the methods of the Content interface which correspond to AuthResourceBundle entries.
      private static AuthResourceBundle.Content getDefaultContent()
      Returns a default Content implementation.
      java.util.Enumeration getKeys()  
      protected java.lang.Object handleGetObject​(java.lang.String key)  
      static void main​(java.lang.String[] args)
      Writes a template .properties file.
      private static java.lang.String toPropertyString​(AuthResourceBundle.Content content, java.lang.reflect.Method method)
      Returns a string suitable for entry into a .properties file for a given Method of a given Content object.
      • Methods inherited from class java.util.ResourceBundle

        clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map_

        private final java.util.Hashtable map_
      • logger_

        private static final java.util.logging.Logger logger_
    • Constructor Detail

      • AuthResourceBundle

        public AuthResourceBundle()
        Constructs default (English) instance.
      • AuthResourceBundle

        protected AuthResourceBundle​(AuthResourceBundle.Content content)
        Constructs a bundle based on a Content implementation.
        Parameters:
        content - contains information required for bundle
    • Method Detail

      • handleGetObject

        protected final java.lang.Object handleGetObject​(java.lang.String key)
        Specified by:
        handleGetObject in class java.util.ResourceBundle
      • getKeys

        public final java.util.Enumeration getKeys()
        Specified by:
        getKeys in class java.util.ResourceBundle
      • getAuthContent

        public static AuthResourceBundle.Content getAuthContent​(java.util.ResourceBundle bundle)
        Returns a Content object based on a bundle which has the keys that AuthResourceBundle is supposed to have. If any of the required keys are missing, the result falls back to a default bundle.
        Parameters:
        bundle - resource bundle
        Returns:
        content object guaranteed to have non-null contents for all its attributes
      • getContentMethods

        static java.lang.reflect.Method[] getContentMethods()
        Returns all the methods of the Content interface which correspond to AuthResourceBundle entries.
        Returns:
        resource bundle methods, all have no arguments and return String
      • checkHasAllKeys

        static void checkHasAllKeys​(java.util.ResourceBundle bundle)
        Determines if a bundle has all the required keys for this class.
        Parameters:
        bundle - bundle to test
      • getDefaultContent

        private static AuthResourceBundle.Content getDefaultContent()
        Returns a default Content implementation.
        Returns:
        english content
      • toPropertyString

        private static java.lang.String toPropertyString​(AuthResourceBundle.Content content,
                                                         java.lang.reflect.Method method)
        Returns a string suitable for entry into a .properties file for a given Method of a given Content object.
        Parameters:
        content - auth resource content
        method - Content method (public String x())
      • main

        public static void main​(java.lang.String[] args)
        Writes a template .properties file. Sensitive to the locale.