Package xal.extension.application
Class Util
java.lang.Object
xal.extension.application.Util
Utility class providing convenience methods for use in the application
framework.
- Author:
- tap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPropertiesForResource
(String propertyFile) Convenience method for loading the resource bundle from a file whose path is specified relative to the application's resources folder.protected static String[]
Parse a string into tokens where whitespace is the delimiter.protected static String[]
Parse a string into tokens with the specified delimiter.loadResourceBundle
(URL resourceURL) Load the resource bundle specified by the URL.static void
mergeResourceBundle
(Map<String, String> map, URL source) Merge the resource bundle from the specified source into the specified map.
-
Constructor Details
-
Util
protected Util()Creates a new instance of Util
-
-
Method Details
-
loadResourceBundle
Load the resource bundle specified by the URL. When the resource bundle is loaded, the properties are stored in a Map for convenience data access.- Parameters:
resourceURL
- The URL to the properties file- Returns:
- The map equivalent of the resource bundle or null if the resource was not found
- Throws:
RuntimeException
-
mergeResourceBundle
Merge the resource bundle from the specified source into the specified map. If the file does not exist at the source, then nothing is merged as this is intended for optional modifications.- Parameters:
map
- the map into which the resources should be mergedsource
- URL to the resource to merge
-
getPropertiesForResource
Convenience method for loading the resource bundle from a file whose path is specified relative to the application's resources folder.- Parameters:
propertyFile
- The property file relative to the application's resources folder- Returns:
- The map equivalent of the resource bundle
- Throws:
MissingResourceException
- If the resource bundle cannot be found.- See Also:
-
getTokens
Parse a string into tokens where whitespace is the delimiter.- Parameters:
string
- The string to parse.- Returns:
- The array of tokens.
-
getTokens
Parse a string into tokens with the specified delimiter.- Parameters:
string
- The string to parse.delim
- The delimiter- Returns:
- The array of tokens.
-