Module org.hsqldb

Class ValidatingResourceBundle

java.lang.Object
org.hsqldb.lib.ValidatingResourceBundle

public class ValidatingResourceBundle extends 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.
  • Field Details

  • Constructor Details

    • ValidatingResourceBundle

      public ValidatingResourceBundle(String baseName, Class<? extends Enum<?>> enumType)
  • Method Details

    • resourceKeyFor

      public static String resourceKeyFor(Enum<?> enumKey)
    • getString

      public String getString(Enum<?> key)
      Parameters:
      key - Enum
      Returns:
      String
      See Also:
    • getString

      public String getString(Enum<?> key, String... strings)
      Parameters:
      key - Enum
      strings - String[]
      Returns:
      String
      See Also:
    • getExpandedString

      public String getExpandedString(Enum<?> key)
      Parameters:
      key - Enum
      Returns:
      String
      See Also:
    • getExpandedString

      public String getExpandedString(Enum<?> key, String... strings)
      Parameters:
      key - Enum
      strings - String[]
      Returns:
      String
      See Also:
    • 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 String getString(Enum<?> key, int i1)
    • getString

      public String getString(Enum<?> key, int i1, int i2)
    • getString

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

      public String getString(Enum<?> key, int i1, String s2)
    • getString

      public String getString(Enum<?> key, String s1, int i2)
    • getString

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

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

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

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

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

      public String getString(Enum<?> key, String s1, int i2, String s3)