Module org.hsqldb

Class ValidatingResourceBundle


  • public class ValidatingResourceBundle
    extends java.lang.Object
    Purpose of this class is to wrap a RefCapablePropertyResourceBundle to reliably detect any possible use of a missing property key as soon as this class is clinitted. The reason for this is to allow us developers to detect all such errors before end-users ever use this class. See SqltoolRB for an example implementation of this abstract class.
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidatingResourceBundle​(java.lang.String baseName, java.lang.Class<? extends java.lang.Enum<?>> enumType)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getExpandedString​(java.lang.Enum<?> key)  
      java.lang.String getExpandedString​(java.lang.Enum<?> key, java.lang.String... strings)  
      int getMissingPosValueBehavior()  
      int getMissingPropertyBehavior()  
      java.lang.String getString​(java.lang.Enum<?> key)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, int i2)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, int i2, int i3)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, int i2, java.lang.String s3)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, java.lang.String s2)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, java.lang.String s2, int i3)  
      java.lang.String getString​(java.lang.Enum<?> key, int i1, java.lang.String s2, java.lang.String s3)  
      java.lang.String getString​(java.lang.Enum<?> key, java.lang.String... strings)  
      java.lang.String getString​(java.lang.Enum<?> key, java.lang.String s1, int i2)  
      java.lang.String getString​(java.lang.Enum<?> key, java.lang.String s1, int i2, int i3)  
      java.lang.String getString​(java.lang.Enum<?> key, java.lang.String s1, int i2, java.lang.String s3)  
      java.lang.String getString​(java.lang.Enum<?> key, java.lang.String s1, java.lang.String s2, int i3)  
      static java.lang.String resourceKeyFor​(java.lang.Enum<?> enumKey)  
      void setMissingPosValueBehavior​(int missingPosValueBehavior)
      Set behavior for get*String(String, String[]) method when a positional index (like %{4}) is used but no subs value was given for that index.
      void setMissingPropertyBehavior​(int missingPropertyBehavior)
      Set behavior for get*String*() method when a referred-to System Property is not set.
      void validate()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidatingResourceBundle

        public ValidatingResourceBundle​(java.lang.String baseName,
                                        java.lang.Class<? extends java.lang.Enum<?>> enumType)
    • Method Detail

      • resourceKeyFor

        public static java.lang.String resourceKeyFor​(java.lang.Enum<?> enumKey)
      • setMissingPropertyBehavior

        public void setMissingPropertyBehavior​(int missingPropertyBehavior)
        Set behavior for get*String*() method when a referred-to System Property is not set. Set to one of
        • RefCapablePropertyResourceBundle.THROW_BEHAVIOR
        • RefCapablePropertyResourceBundle.EMPTYSTRING_BEHAVIOR
        • RefCapablePropertyResourceBundle.NOOP_BEHAVIOR
        The first value is the default.
        Parameters:
        missingPropertyBehavior - int
      • setMissingPosValueBehavior

        public void setMissingPosValueBehavior​(int missingPosValueBehavior)
        Set behavior for get*String(String, String[]) method when a positional index (like %{4}) is used but no subs value was given for that index. Set to one of
        • RefCapablePropertyResourceBundle.THROW_BEHAVIOR
        • RefCapablePropertyResourceBundle.EMPTYSTRING_BEHAVIOR
        • RefCapablePropertyResourceBundle.NOOP_BEHAVIOR
        The first value is the default.
        Parameters:
        missingPosValueBehavior - int
      • getMissingPropertyBehavior

        public int getMissingPropertyBehavior()
      • getMissingPosValueBehavior

        public int getMissingPosValueBehavior()
      • validate

        public void validate()
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          int i2)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          int i2,
                                          int i3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          java.lang.String s2)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          java.lang.String s1,
                                          int i2)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          int i2,
                                          java.lang.String s3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          java.lang.String s2,
                                          int i3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          java.lang.String s1,
                                          int i2,
                                          int i3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          int i1,
                                          java.lang.String s2,
                                          java.lang.String s3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          java.lang.String s1,
                                          java.lang.String s2,
                                          int i3)
      • getString

        public java.lang.String getString​(java.lang.Enum<?> key,
                                          java.lang.String s1,
                                          int i2,
                                          java.lang.String s3)