All Packages Class Hierarchy This Package Previous Next Index
Class com.sgi.sysadm.util.ResourceStack
java.lang.Object
|
+----com.sgi.sysadm.util.ResourceStack
- public class ResourceStack
- extends Object
- implements Cloneable
ResourceStack maintains a stack of ResourceBundles. Clients can
easily search for a property in the whole stack.
A new ResourceBundle may be pushed onto the top of
the stack using ResourceStack.pushBundle().
Many of the get* methods in this class have four versions. For
example purposes, consider getString.
- getString(String key)
- Looks up the specified key in the ResourceStack and return the
associated value. If the key is missing, a
MissingResourceException will be thrown.
- getString(String[] keys)
- Looks up the specifed keys in the ResourceStack, one after
another, until a key is found in the ResourceStack. The value
associated with that key is then returned. If none of the keys are
found, a MissingResourceException is thrown. This version is
useful if you want to lookup a particular resource, but then fall
back to another resource if the first resource is not found.
- getString(String key, String defaultVal)
- The same as the getString(String key) case, but instead of
returning a MissingResourceException if the key is not found, the
defaultVal will be returned. This is useful in cases where the
calling method wants to lookup a resource, but has a default value
that it can use if the lookup fails. This reduces the overhead of
having to catch the MissingResourceException.
- getString(String[] keys, String defaultVal)
- The same as the getString(String[] keys) case, but it takes a
default value. See the case above for more info about the
defaultValue.
ResourceStack supports macros in Properties files as
follows: Any key or value that is loaded into a ResourceStack
via the pushBundle method will be parsed for ${MACRO}. The
resource MACRO will be looked up and substituted for
${MACRO}.
Macros in resource keys are resolved when the resource file is
loaded - for that reason macros in keys must be defined in the same
property file. Macros in resource values are resolved when the
lookup (with getString(), etc) is made. For this reason, the
definition of a macro in a value can be in the same propery file or
in any resource bundle on the stack when the lookup is made.
-
BUNDLE_SUFFIX
- The suffix to append to all property files
For example, myProperties<BUNDLE_SUFFIX>.properties.
-
ICON_HEIGHT
- The Resource <Icon key>.iconHeight is an integer
that specifies the height, in points, of the FtrIcon identified
by <Icon key>.
-
ICON_WIDTH
- The Resource <Icon key>.iconWidth is an integer
that specifies the width, in points, of the FtrIcon identified
by <Icon key>.
-
ResourceStack()
- Create a ResourceStack with only
com.sgi.sysadm.util.SysadmUtilP on it
-
clone()
- Makes an exact copy of the ResourceStack.
-
getBoolean(String)
- Search for a boolean resource in the resource stack.
-
getBoolean(String, boolean)
- Search for a boolean resource in the resource stack.
-
getBoolean(String[])
- Search for a boolean resource in the resource stack.
-
getBoolean(String[], boolean)
- Search for a boolean resource in the resource stack.
-
getClassName(Class)
- Convenience method for getting the name of a class without the
package prefix.
-
getClassName(String)
- Convenience method for getting the name of a class without the
package prefix.
-
getColor(String)
- Search for a Color resource in the resource stack.
-
getColor(String, Color)
- Search for a Color resource in the resource stack.
-
getColor(String[])
- Search for a Color resource in the resource stack.
-
getColor(String[], Color)
- Search for a Color resource in the resource stack.
-
getFloat(String)
- Search for a float resource in the resource stack
-
getFloat(String, float)
- Search for a float resource in the resource stack.
-
getFloat(String[])
- Search for a float resource in the resource stack.
-
getFloat(String[], float)
- Search for a float resource in the resource stack.
-
getFont(String)
- Search for a Font resource in the resource stack.
-
getFont(String, Font)
- Search for a Font resource in the resource stack.
-
getFont(String[])
- Search for a Font resource in the resource stack.
-
getFont(String[], Font)
- Search for a Font resource in the resource stack.
-
getIcon(String)
- Get an icon resource.
-
getIcon(String[])
- Get an icon resource.
-
getInt(String)
- Search for an int resource in the resource stack
-
getInt(String, int)
- Search for an int resource in the resource stack.
-
getInt(String[])
- Search for an int resource in the resource stack.
-
getInt(String[], int)
- Search for an int resource in the resource stack.
-
getObject(String)
- Search for a resource in the resource stack
-
getObject(String, Object)
- Search for a resource in the resource stack.
-
getObject(String[])
- Search for a resource in the resource stack.
-
getObject(String[], Object)
- Search for a resource in the resource stack.
-
getPackageName(Class)
- Convenience method for getting the package name of a class.
-
getPackageName(String)
- Convenience method for getting the package name of a class.
-
getPixels(String)
- Search for a pixel resource in the resource stack.
-
getPixels(String, int)
- Search for a pixel resource in the resource stack.
-
getPixels(String[])
- Search for a pixel resource in the resource stack.
-
getPixels(String[], int)
- Search for a pixel resource in the resource stack.
-
getString(String)
- Search for a String resource in the resource stack
-
getString(String, String)
- Search for a String resource in the resource stack.
-
getString(String[])
- Search for a String resource in the resource stack.
-
getString(String[], String)
- Search for a String resource in the resource stack.
-
getStringArray(String)
- Search for a set of properties that defines a string array.
-
getStringArray(String, String[])
- Search for a set of properties that defines a string array.
-
getStringArray(String[])
- Search for a set of properties that defines a string array.
-
getStringArray(String[], String[])
- Search for a set of properties that defines a string array.
-
getTaskLoaders(String, HostContext)
- Search for an array of TaskLoaders in the resource stack.
-
getTaskLoaders(String[], HostContext)
- Search for an array of TaskLoaders in the resource stack.
-
mapStringToByte(String, String[], byte[])
- Convert a String to a Byte, based on a mapping.
-
pushBundle(ResourceBundle)
- Push a new ResourceBundle onto the bundle stack.
-
pushBundle(String)
- Push a new ResourceBundle onto the bundle stack.
-
pushPackageBundles(String)
- Search the package path for package ResourceBundles.
-
pushStack(ResourceStack)
- Push the ResourceBundles from another ResourceStack onto the
bundle stack.
-
toString()
- Return the names of the ResourceBundles in this stack in the
order in which they will be searched for resources.
ICON_WIDTH
public static final String ICON_WIDTH
- The Resource <Icon key>.iconWidth is an integer
that specifies the width, in points, of the FtrIcon identified
by <Icon key>. For example, to specify the width and
height of an FtrIcon, put the following in the ResourceFile:
Icon = com.sgi.sysadm.MyIcon
Icon.iconWidth = 5
Icon.iconHeight = 5
If this resource is missing, the default width for an FtrIcon
will be used.
ICON_HEIGHT
public static final String ICON_HEIGHT
- The Resource <Icon key>.iconHeight is an integer
that specifies the height, in points, of the FtrIcon identified
by <Icon key>.
See ICON_WIDTH for an example.
If this resource is missing, the default height for an FtrIcon
will be used.
- See Also:
- ICON_WIDTH
BUNDLE_SUFFIX
public static final String BUNDLE_SUFFIX
- The suffix to append to all property files
For example, myProperties<BUNDLE_SUFFIX>.properties.
The value is "P".
ResourceStack
public ResourceStack()
- Create a ResourceStack with only
com.sgi.sysadm.util.SysadmUtilP on it
clone
public Object clone()
- Makes an exact copy of the ResourceStack.
- Returns:
- The copy.
- Overrides:
- clone in class Object
- See Also:
- clone
getClassName
public static String getClassName(Class classObj)
- Convenience method for getting the name of a class without the
package prefix. Classes that wish to prefix all of their property
names with the class name will find this method useful.
- Parameters:
- classObj - Class object from which to get the class name.
- Returns:
- class name without package portion of name.
getClassName
public static String getClassName(String className)
- Convenience method for getting the name of a class without the
package prefix. Classes that wish to prefix all of their property
names with the class name will find this method useful.
- Parameters:
- className - String containing a fully qualified class name.
- Returns:
- class name without package portion of name.
getPackageName
public static String getPackageName(Class classObj)
- Convenience method for getting the package name of a class.
- Parameters:
- class - Class object from which to get the package name.
- Returns:
- package name of class, including trailing '.'
getPackageName
public static String getPackageName(String fullClassName)
- Convenience method for getting the package name of a class.
- Parameters:
- fullClassName - Fully qualified class name from which to
get the package name.
- Returns:
- package name of class fullClassName,
including trailing '.'
pushBundle
public void pushBundle(String bundleName) throws MissingResourceException
- Push a new ResourceBundle onto the bundle stack. This bundle will
be searched before any bundles already on the bundle stack.
- Parameters:
- bundleName - Name of ResourceBundle to push onto the stack.
- Throws: MissingResourceException
- Thrown if bundleName
is not found.
pushBundle
public void pushBundle(ResourceBundle bundle)
- Push a new ResourceBundle onto the bundle stack. This bundle will
be searched before any bundles already on the bundle stack.
bundle.toString() will be used as the bundle's name; if another
bundle with the same name is lower in the stack, it will be removed.
If you push a bundle, and then change its contents, the ResourceStack
won't re-cache its contents until you push the bundle again.
- Parameters:
- bundle - ResourceBundle to push onto the stack.
pushStack
public void pushStack(ResourceStack other)
- Push the ResourceBundles from another ResourceStack onto the
bundle stack. Bundles from other will be searched
before any bundles already on the bundle stack. Bundles from
other will not be pushed if they are already on the
stack, and those Bundles will remain in their old location on
the stack.
If other is null, pushStack does nothing.
- Parameters:
- other - ResourceStack providing ResourceBundles to be
pushed onto the bundle stack.
pushPackageBundles
public void pushPackageBundles(String objectName)
- Search the package path for package ResourceBundles. The
search starts from the root of the path and works
downwards. For example, if the class name is
"com.sgi.product.doSomethingTask", the search will first
look for com.PackageP, then com.sgi.PackageP, etc. up through
com.sgi.product.doSomethingTask.PackageP. There
can be zero or more such package properties files, each
being pushed onto the stack as it is found. The result is
that package properties files closer to the package root
will be overridden by package properties files farther from
the package root.
- Parameters:
- objectName - The package-qualified name of the object for
which package bundles should be loaded.
toString
public String toString()
- Return the names of the ResourceBundles in this stack in the
order in which they will be searched for resources.
- Overrides:
- toString in class Object
getObject
public Object getObject(String key) throws MissingResourceException
- Search for a resource in the resource stack
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getObject
public Object getObject(String keys[]) throws MissingResourceException
- Search for a resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getObject
public Object getObject(String key,
Object defaultVal)
- Search for a resource in the resource stack.
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The resource described by key, or
defaultVal if no value is found.
getObject
public Object getObject(String keys[],
Object defaultVal)
- Search for a resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys, or defaultVal if no value is found.
getIcon
public Icon getIcon(String keys[]) throws MissingResourceException
- Get an icon resource.
- Parameters:
- key - Name of icon. This can either be the class name of
an FtrIcon subclass, or the full path name of an
image. If key is the name of an FtrIcon,
the resources <key>.iconWidth and
<key>.iconHeight may also be present.
Default values will be used if these resources are missing.
These two resources specify the width and height in
points of the FtrIcon.
- Returns:
- Icon resource
- Throws: MissingResourceException
- if resource is missing.
- See Also:
- ICON_WIDTH, ICON_HEIGHT
getIcon
public Icon getIcon(String key) throws MissingResourceException
- Get an icon resource.
- Parameters:
- keys - An array of possible names of the icon. These can
either be the class names of FtrIcon subclasses, or
the full path names of images. If a key
is the name of an FtrIcon, the resources
<key>.iconWidth and
<key>.iconHeight may also be
present. These two resources specify the width and
height in points of the FtrIcon. Default values
will be used if these resources are missing. The
array will be searched, in order, until a Icon
resource is found.
- Returns:
- Icon resource
- Throws: MissingResourceException
- if resource is missing.
- See Also:
- ICON_WIDTH, ICON_HEIGHT
getString
public String getString(String key) throws MissingResourceException
- Search for a String resource in the resource stack
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The String described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getString
public String getString(String keys[]) throws MissingResourceException
- Search for a String resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first String resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getString
public String getString(String key,
String defaultVal)
- Search for a String resource in the resource stack.
- Parameters:
- key - Name of the String resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The String resource described by key or
defaultVal if no value is found.
getString
public String getString(String keys[],
String defaultVal)
- Search for a String resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first String resource that is found matching a key in
keys or defaultVal if no value is found.
getStringArray
public String[] getStringArray(String baseKey) throws MissingResourceException
- Search for a set of properties that defines a string array.
For example, if the baseKey is "myKey", then the
strings should be of the form:
myKey0: valueA
myKey1: valueB
- Parameters:
- baseKey - Base name of array property to retrieve.
- Returns:
- String[] containing array of strings described
by baseKey.
- Throws: MissingResourceException
- if the set of properties
is not found.
getStringArray
public String[] getStringArray(String baseKeys[]) throws MissingResourceException
- Search for a set of properties that defines a string array.
For example, if one of the baseKeys is "myKey", then the
strings should be of the form:
myKey0: valueA
myKey1: valueB
- Parameters:
- baseKeys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the set of properties
is not found.
getStringArray
public String[] getStringArray(String baseKeys[],
String defaultVal[])
- Search for a set of properties that defines a string array.
For example, if one of the baseKeys is "myKey", then the
strings should be of the form:
myKey0: valueA
myKey1: valueB
- Parameters:
- baseKeys - Base names of array property to search. The
names will be looked up, in order, until a
stringArray resource is found.
- Returns:
- String[] containing array of strings described
by baseKey or defaultVal if no value is found.
getStringArray
public String[] getStringArray(String baseKey,
String defaultVal[])
- Search for a set of properties that defines a string array.
For example, if the baseKey is "myKey", then the
strings should be of the form:
myKey0: valueA
myKey1: valueB
- Parameters:
- baseKey - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys or defaultVal if no value is found.
getInt
public int getInt(String key) throws MissingResourceException
- Search for an int resource in the resource stack
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The int resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getInt
public int getInt(String keys[]) throws MissingResourceException
- Search for an int resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first int resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getInt
public int getInt(String key,
int defaultVal)
- Search for an int resource in the resource stack.
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The int resource described by key or
defaultVal if no value is found.
getInt
public int getInt(String keys[],
int defaultVal)
- Search for an int resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first int resource that is found matching a key in
keys or defaultVal if no value is found.
getPixels
public int getPixels(String key) throws MissingResourceException
- Search for a pixel resource in the resource stack. The
resource will be interpreted as an integer representing a
distance in points (1 point = 1/72 of an inch), and the points
will be converted to pixels.
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The pixel resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getPixels
public int getPixels(String keys[]) throws MissingResourceException
- Search for a pixel resource in the resource stack. The
resource will be interpreted as an integer representing a
distance in points (1 point = 1/72 of an inch), and the points
will be converted to pixels
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first pixel resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getPixels
public int getPixels(String key,
int defaultVal)
- Search for a pixel resource in the resource stack. The
resource will be interpreted as an integer representing a
distance in points (1 point = 1/72 of an inch), and the points
will be converted to pixels
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found. The int will
be converted from points to pixels
- Returns:
- The pixel resource described by key or
defaultVal if no value is found.
getPixels
public int getPixels(String keys[],
int defaultVal)
- Search for a pixel resource in the resource stack. The
resource will be interpreted as an integer representing a
distance in points (1 point = 1/72 of an inch), and the points
will be converted to pixels
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found. The int will be converted from
points to pixels
- Returns:
- The first pixel resource that is found matching a key in
keys or defaultVal if no value is found.
getFloat
public float getFloat(String key) throws MissingResourceException
- Search for a float resource in the resource stack
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getFloat
public float getFloat(String keys[]) throws MissingResourceException
- Search for a float resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getFloat
public float getFloat(String key,
float defaultVal)
- Search for a float resource in the resource stack.
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The resource described by key or
defaultVal if no value is found.
getFloat
public float getFloat(String keys[],
float defaultVal)
- Search for a float resource in the resource stack.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys or defaultVal if no value is found.
getFont
public Font getFont(String key) throws MissingResourceException
- Search for a Font resource in the resource stack. The font
must be specifed in a way that can be understood by Font.decode()
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
- See Also:
- decode
getFont
public Font getFont(String keys[]) throws MissingResourceException
- Search for a Font resource in the resource stack. The font
must be specifed in a way that can be understood by Font.decode()
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
- See Also:
- decode
getFont
public Font getFont(String key,
Font defaultVal)
- Search for a Font resource in the resource stack. The font
must be specifed in a way that can be understood by Font.decode()
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The resource described by key or
defaultVal if no value is found.
- See Also:
- decode
getFont
public Font getFont(String keys[],
Font defaultVal)
- Search for a Font resource in the resource stack. The font
must be specifed in a way that can be understood by Font.decode()
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys or defaultVal if no value is found.
- See Also:
- decode
getColor
public Color getColor(String key) throws MissingResourceException
- Search for a Color resource in the resource stack. The color
must be specifed in a way that can be understood by Color.decode()
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
- See Also:
- decode
getColor
public Color getColor(String keys[]) throws MissingResourceException
- Search for a Color resource in the resource stack. The color
must be specifed in a way that can be understood by Color.decode()
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
- See Also:
- decode
getColor
public Color getColor(String key,
Color defaultVal)
- Search for a Color resource in the resource stack. The color
must be specifed in a way that can be understood by Color.decode()
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The resource described by key or
defaultVal if no value is found.
- See Also:
- decode
getColor
public Color getColor(String keys[],
Color defaultVal)
- Search for a Color resource in the resource stack. The color
must be specifed in a way that can be understood by Color.decode()
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys or defaultVal if no value is found.
- See Also:
- decode
getBoolean
public boolean getBoolean(String key) throws MissingResourceException
- Search for a boolean resource in the resource stack. Set the
resource to "true" to represent true, anything else for false.
- Parameters:
- key - Name of the resource to retrieve.
- Returns:
- The resource described by key.
- Throws: MissingResourceException
- if the resource
is not found.
getBoolean
public boolean getBoolean(String keys[]) throws MissingResourceException
- Search for a boolean resource in the resource stack. Set the
resource to "true" to represent true, anything else for false.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
getBoolean
public boolean getBoolean(String key,
boolean defaultVal)
- Search for a boolean resource in the resource stack. Set the
resource to "true" to represent true, anything else for false.
- Parameters:
- key - Name of the resource to retrieve.
- defaultVal - The resource to return if no resource
matching key is found.
- Returns:
- The resource described by key or
defaultVal if no value is found.
getBoolean
public boolean getBoolean(String keys[],
boolean defaultVal)
- Search for a boolean resource in the resource stack. Set the
resource to "true" to represent true, anything else for false.
- Parameters:
- keys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned.
- defaultVal - The object to return if no matching properties
are found.
- Returns:
- The first resource that is found matching a key in
keys or defaultVal if no value is found.
mapStringToByte
public static byte mapStringToByte(String input,
String strings[],
byte bytes[])
- Convert a String to a Byte, based on a mapping.
strings will be searched for input, and the
corresponding Byte from bytes will be returned.
For example, a call to the following will return a Byte set to 1:
mapStringToBytes("NO",
new String[] {"YES", "NO", "MAYBE"},
new Byte[] {0, 1, 2));
- Parameters:
- input - The String to convert
- strings - The list of Strings
- bytes - The list of bytes
getTaskLoaders
public TaskLoader[] getTaskLoaders(String baseKey,
HostContext hc)
- Search for an array of TaskLoaders in the resource stack.
For example, if a resource file contained:
myTasks0 = com.sgi.myPackage.CreateTask
myTasks1 = com.sgi.myPackage.ModifyTask
myTasks2 = com.sgi.myPackage.DeleteTask
The a call to getTaskLoaders("myTasks", _hostContext)
would return an array of three TaskLoaders corresponding to the
Tasks mentioned.
- Parameters:
- baseKey - The base key of the TaskLoaders to load. The
format of the resources should be the same as the
getStringArray, and the values should be the fully qualified
names of Tasks.
- Returns:
- An array of TaskLoaders corresponding to the Tasks
described by key
- Throws: MissingResourceException
- if the resource
is not found.
- See Also:
- getStringArray
getTaskLoaders
public TaskLoader[] getTaskLoaders(String baseKeys[],
HostContext hc)
- Search for an array of TaskLoaders in the resource stack.
See the version of getTaskLoaders that takes a single baseKey
for more information.
- Parameters:
- baseKeys - An array of Strings containing the resource names to
look up. The names will be looked up, in order, and
the first resource found will be returned. The
format of the resources should be the same as
the getStringArray, and the values should be
the fully qualified names of Tasks.
- Returns:
- The first resource that is found matching a key in
keys
- Throws: MissingResourceException
- if the property
is not found.
- See Also:
- getTaskLoaders, getStringArray
All Packages Class Hierarchy This Package Previous Next Index