- java.lang.Object
-
- org.hsqldb.lib.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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
EMPTYSTRING_BEHAVIOR
static int
NOOP_BEHAVIOR
static int
THROW_BEHAVIOR
-
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()
-
-
-
Field Detail
-
THROW_BEHAVIOR
public static final int THROW_BEHAVIOR
- See Also:
- Constant Field Values
-
EMPTYSTRING_BEHAVIOR
public static final int EMPTYSTRING_BEHAVIOR
- See Also:
- Constant Field Values
-
NOOP_BEHAVIOR
public static final int NOOP_BEHAVIOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
resourceKeyFor
public static java.lang.String resourceKeyFor(java.lang.Enum<?> enumKey)
-
getString
public java.lang.String getString(java.lang.Enum<?> key)
- Parameters:
key
- Enum- Returns:
- String
- See Also:
RefCapablePropertyResourceBundle.getString(String)
-
getString
public java.lang.String getString(java.lang.Enum<?> key, java.lang.String... strings)
- Parameters:
key
- Enumstrings
- String[]- Returns:
- String
- See Also:
RefCapablePropertyResourceBundle.getString(String, String[], int)
-
getExpandedString
public java.lang.String getExpandedString(java.lang.Enum<?> key)
- Parameters:
key
- Enum- Returns:
- String
- See Also:
RefCapablePropertyResourceBundle.getExpandedString(String, int)
-
getExpandedString
public java.lang.String getExpandedString(java.lang.Enum<?> key, java.lang.String... strings)
- Parameters:
key
- Enumstrings
- String[]- Returns:
- String
- See Also:
RefCapablePropertyResourceBundle.getExpandedString(String, String[], int, int)
-
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
- 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
- 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)
-
-