public final class IlrResources
extends java.lang.Object
implements java.io.Serializable
A resource bundle is a list of properties with associated values.
During creation, the user can specify the initial resources to
load into the bundle. Later on, the user can call one of the methods
for loading more resources. Each time a resource stream is loaded, a
symbolic name is appended to a list. This provides a mean for identifying
the resource streams which have been loaded and to avoid loading a same
stream several times. Moreover, the class may be set a
ClassLoader to be used for finding the resource files.
See the User's Manual for more details.
| Constructor and Description |
|---|
IlrResources()
Deprecated.
Constructs a resource bundle with no arguments.
|
IlrResources(boolean init)
Deprecated.
Constructs a resource bundle with a boolean argument.
|
IlrResources(IlrResources initial)
Deprecated.
Constructs a resource bundle using another resource bundle.
|
IlrResources(java.io.Reader reader)
Deprecated.
Constructs a resource bundle and initializes its content using
a reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
Clears the properties and their associated values in this resource
bundle.
|
void |
clearToDefaults()
Deprecated.
Clears all the properties and their associated values, and then
loads the engine's default settings from the file
/ilog/rules/engine/engine.conf provided in the
IBM Decision server engine
Jar files. |
boolean |
containsKey(java.lang.String key)
Deprecated.
Tests whether a particular string is a key of the property map.
|
boolean |
containsName(java.lang.String name)
Deprecated.
Tests if a stream of some name has already been loaded.
|
java.util.Set |
entrySet()
Deprecated.
Returns a set view of the hash table used to manage the associations
between property names and their values.
|
boolean |
forClass(java.lang.Class cl)
Deprecated.
Loads a resource stream using a class.
|
boolean |
forObject(java.lang.Object obj)
Deprecated.
Loads a resource stream using an object.
|
boolean |
forPackage(java.lang.String pkg)
Deprecated.
Loads a resource stream using a package name.
|
java.lang.Object |
get(java.lang.String key,
java.lang.Object def)
Deprecated.
Gets the property value associated to a key and returns a default
value is the key does not exist.
|
java.lang.Object[] |
getArray(java.lang.String key,
java.lang.Object[] def)
Deprecated.
Gets the property value associated to a key as an array of objects
and returns a default value is the key does not exist.
|
boolean |
getBoolean(java.lang.String key,
boolean def)
Deprecated.
Gets the property value associated to a key as a boolean value
and returns a default value is the key does not exist.
|
boolean[] |
getBooleanArray(java.lang.String key,
boolean[] def)
Deprecated.
Gets the property value associated to a key as an array of booleans
and returns a default value is the key does not exist.
|
char |
getChar(java.lang.String key,
char def)
Deprecated.
Gets the property value associated to a key as a char
and returns a default value is the key does not exist.
|
char[] |
getCharArray(java.lang.String key,
char[] def)
Deprecated.
Gets the property value associated to a key as a char array
and returns a default value is the key does not exist.
|
java.lang.ClassLoader |
getClassLoader()
Deprecated.
Gets the class loader previously set.
|
double |
getDouble(java.lang.String key,
double def)
Deprecated.
Gets the property value associated to a key as a double
and returns a default value is the key does not exist.
|
double[] |
getDoubleArray(java.lang.String key,
double[] def)
Deprecated.
Gets the property value associated to a key as a double array
and returns a default value is the key does not exist.
|
float |
getFloat(java.lang.String key,
float def)
Deprecated.
Gets the property value associated to a key as a float
and returns a default value is the key does not exist.
|
float[] |
getFloatArray(java.lang.String key,
float[] def)
Deprecated.
Gets the property value associated to a key as a float array
and returns a default value is the key does not exist.
|
int |
getInt(java.lang.String key,
int def)
Deprecated.
Gets the property value associated to a key as an int
and returns a default value is the key does not exist.
|
int[] |
getIntArray(java.lang.String key,
int[] def)
Deprecated.
Gets the property value associated to a key as an int array
and returns a default value is the key does not exist.
|
long |
getLong(java.lang.String key,
long def)
Deprecated.
Gets the property value associated to a key as a long
and returns a default value is the key does not exist.
|
long[] |
getLongArray(java.lang.String key,
long[] def)
Deprecated.
Gets the property value associated to a key as a long array
and returns a default value is the key does not exist.
|
java.lang.String |
getName()
Deprecated.
Gets the resource name which has been appended the most lately, i.e.
|
java.lang.String[] |
getNames()
Deprecated.
Gets the names of the resource streams that have been loaded.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String def)
Deprecated.
Gets the property value associated to a key as a string
and returns a default value is the key does not exist.
|
java.lang.String[] |
getStringArray(java.lang.String key,
java.lang.String[] def)
Deprecated.
Gets the property value associated to a key as an array of strings
and returns a default value is the key does not exist.
|
boolean |
load(java.io.InputStream str)
Deprecated.
Loads a resource stream using an
InputStream. |
boolean |
load(java.io.Reader reader)
Deprecated.
Loads a resource stream using a reader.
|
boolean |
load(java.lang.String filename)
Deprecated.
Loads a resource stream using a file name.
|
void |
put(java.lang.String key,
java.lang.Object value)
Deprecated.
Adds or rebinds the value associated to a property name.
|
void |
putAll(IlrResources resources)
Deprecated.
Puts all the properties and values stored in the argument resource
bundle into the current bundle.
|
void |
putBoolean(java.lang.String key,
boolean value)
Deprecated.
Adds or rebinds a boolean value associated to a property name.
|
void |
putChar(java.lang.String key,
char value)
Deprecated.
Adds or rebinds a char value associated to a property name.
|
void |
putDouble(java.lang.String key,
double value)
Deprecated.
Adds or rebinds a double value associated to a property name.
|
void |
putFloat(java.lang.String key,
float value)
Deprecated.
Adds or rebinds a float value associated to a property name.
|
void |
putInt(java.lang.String key,
int value)
Deprecated.
Adds or rebinds a int value associated to a property name.
|
void |
putLong(java.lang.String key,
long value)
Deprecated.
Adds or rebinds a long value associated to a property name.
|
void |
putString(java.lang.String key,
java.lang.String value)
Deprecated.
Adds or rebinds a string value associated to a property name.
|
java.lang.Object |
remove(java.lang.String key)
Deprecated.
Removes an entry using its key if it exists.
|
void |
setClassLoader(java.lang.ClassLoader cl)
Deprecated.
Sets a class loader.
|
public IlrResources()
true
in order to load the initial default resources.public IlrResources(boolean init)
false, the resource bundle is left
empty.
If it is true, then the resource file
/ilog/rules/engine/engine.conf provided in the IBM
Decision Server engine Jar
files is loaded. Following this, one of the following files is loaded:
/META-INF/engine.conf. If it exists, it is loaded and
the next step is skipped.
ilog.rules.engine.config.file, provided
that the property is defined and the file exists.
The later operation is subject to the existence of the file and to the permission of the security manager. If the file does not exist, or the file can not be read, or permission is not granted for reading that file, the loading will simply be ignored.
public IlrResources(java.io.Reader reader)
reader - A reader to load.public IlrResources(IlrResources initial)
public java.lang.ClassLoader getClassLoader()
null if no class loader
has been set.public void setClassLoader(java.lang.ClassLoader cl)
cl - A class loader.public void clear()
public void clearToDefaults()
/ilog/rules/engine/engine.conf provided in the
IBM Decision server engine
Jar files. After this call, the resource bundle will contain only
the IBM Decision server default settings.public void putAll(IlrResources resources)
resources - A resource bundle from which the properties and
values are copied.public java.util.Set entrySet()
Map.Entry. For more details, refer to
the entrySet() method of the Hashtable class.public boolean load(java.io.Reader reader)
meta.name will be appended to the list
of names if the list does not already contain this name. In other words,
if this is the first time that the reader is loaded and if the content
defines a string value for meta.name property, and
provided that
there is no resource stream having the same name, then the name will
be appended to the list.
Later on, you could know which resource streams have been loaded and implement specific code for loading resource streams only if they have not been loaded. Care should be taken in assigning a meaningful name. If the resource stream is for a package, then a package name is good for identifying the stream.
reader - The resource stream to load.true if the stream contains well formed properties,
and false if the stream raises syntax errors or I/O
exceptions.public boolean load(java.io.InputStream str)
InputStream. This method
redirects the loading to the method using Reader. If the
property ilog.rules.engine.encoding is defined, its value
is taken as the encoding for this operation. Otherwise, the system's
default encoding is applied.str - The resource stream to load.true if the stream contains well formed properties,
and false if the stream raises syntax errors or I/O
exceptions.load(java.io.Reader)public boolean load(java.lang.String filename)
Reader and applies
the same encoding as for load(java.io.InputStream).true if the stream contains well formed properties,
and false if the stream raises syntax errors or I/Oload(java.io.Reader)public boolean forPackage(java.lang.String pkg)
com.sun.mypackage. This
method looks for a resource stream named
/com/sun/mypackage/engine.conf. If one is found, it is
loaded using the load(java.io.InputStream) method.pkg - A well formed Java package name.true if the stream is found and its content is
well-formed, and false if the stream is not found or
there are syntax errors, or there are I/O exceptions.load(java.io.InputStream)public boolean forClass(java.lang.Class cl)
engine.conf to the passed class. If the
stream is found, it is loaded
using the load(java.io.InputStream) method.cl - A Java class.true if the stream is found and its content is
well-formed, and false if the stream is not found or
there are syntax errors, or there are I/O exceptions.load(java.io.InputStream)public boolean forObject(java.lang.Object obj)
forClass.obj - An object.true if the stream is found and its content is
well-formed, and false if the stream is not found or
there are syntax errors, or there are I/O exceptions.forClass(java.lang.Class)public java.lang.String[] getNames()
load(java.io.Reader)public java.lang.String getName()
null.public boolean containsName(java.lang.String name)
name - The name of the resource stream.true if the name is part of the loaded name list,
and false otherwise.public java.lang.Object get(java.lang.String key,
java.lang.Object def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public java.lang.Object[] getArray(java.lang.String key,
java.lang.Object[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public java.lang.String getString(java.lang.String key,
java.lang.String def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public java.lang.String[] getStringArray(java.lang.String key,
java.lang.String[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public boolean getBoolean(java.lang.String key,
boolean def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public boolean[] getBooleanArray(java.lang.String key,
boolean[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public char getChar(java.lang.String key,
char def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public char[] getCharArray(java.lang.String key,
char[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public int getInt(java.lang.String key,
int def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public int[] getIntArray(java.lang.String key,
int[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public long getLong(java.lang.String key,
long def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public long[] getLongArray(java.lang.String key,
long[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public float getFloat(java.lang.String key,
float def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public float[] getFloatArray(java.lang.String key,
float[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public double getDouble(java.lang.String key,
double def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public double[] getDoubleArray(java.lang.String key,
double[] def)
key - The property name.def - The default value to be returned if the key does not exist.def if
the key does not exist.public java.lang.Object remove(java.lang.String key)
key - The property name.null
if the key is not an entry.public boolean containsKey(java.lang.String key)
key - The property name.true is the passed argument is a key.public void put(java.lang.String key,
java.lang.Object value)
key - The property name.value - The property value.public void putString(java.lang.String key,
java.lang.String value)
key - The property name.value - The property value.public void putBoolean(java.lang.String key,
boolean value)
key - The property name.value - The property value.public void putChar(java.lang.String key,
char value)
key - The property name.value - The property value.public void putInt(java.lang.String key,
int value)
key - The property name.value - The property value.public void putLong(java.lang.String key,
long value)
key - The property name.value - The property value.public void putFloat(java.lang.String key,
float value)
key - The property name.value - The property value.public void putDouble(java.lang.String key,
double value)
key - The property name.value - The property value.© Copyright IBM Corp. 1987, 2017