Tut.createOption
,
Tut.getOption
, and Tut.removeOption
.
The options database consists of a table of these objects. When a Property database is loaded, these objects are automatically created.
The value of all options is a String. However, these may be extracted as a boolean, an int, a double, or a Vector of Strings if the value contains a comma-separated list. Also, String values can be verified against a list of legal values (Enum), or mapped to a list of integers (EnumMap).
To set the value of a standard SmartSockets option, you may either get the TipcOption instance for that option, or you can use a convenience method:
TipcOption opt = Tut.getOption("ss.project"); opt.setValue("foo"); - or - Tut.setOption("ss.project", "foo");
Options must be created before they can be set, retrieved, or removed.
All of the standard SmartSockets options are created when the process
starts up. If you wish to add your own options, you must use
Tut.createOption
to create the option and add it to the options
table:
TipcOption opt = Tut.createOption("foo", "bar"); ... TipcOption opt = Tut.getOption("foo"); String s = opt.getValueStr(); - or - String s = Tut.getOptionStr("foo");
If you wish to create an Enum or EnumMap option, you must then
add a list of legal values to the option with addEnumLegalValue
and addEnumMapLegalValue
. Enums and EnumMaps
cannot be intermixed; a given option must support one or the other,
not both:
TipcOption opt = Tut.createOption("enum_foo", "baz"); opt.addEnumMapLegalValue("baz", 0); opt.addEnumMapLegalValue("bat", 1); opt.addEnumMapLegalValue("bark", 2); ... TipcOption opt = Tut.getOption("enum_foo"); int i = opt.getValueEnumMap();
For a list of all members of this type, see TipcOption Members.
System.Object
TipcOption
Namespace: TIBCO.SMARTSOCKETS Namespace
Assembly: TIBCO.SS.dll
TipcOption Members | TIBCO.SMARTSOCKETS Namespace