org.eclipse.rse.core.model
Interface IPropertySet
-
All Superinterfaces:
-
IPropertySetContainer
-
All Known Implementing Classes:
-
PropertyList,
PropertySet
-
public interface IPropertySet
- extends
IPropertySetContainer
A Property Set stores key/value pairs, where the keys are Strings and the
values are an
IProperty
, of a type declared by an
IPropertyType
.
The Property Set is identified by a name. By default, the type of each
property is of type String, and in fact each value can be retrieved in String
representation.
The key "description"
is reserved for internal use, to store the
description of the Property set.
DESCRIPTION_KEY
static final
String DESCRIPTION_KEY
- The key used to store the description of the Property Set.
This is no longer used and should not be referenced except for
compatibility reasons.
-
See Also:
-
Constant Field Values
getName
String getName()
- Return the name of this Property Set.
-
-
-
Returns:
- String name of the Property Set.
getDescription
String getDescription()
- Return the description of this Property Set.
Note that in order to set the description, you need to call
addProperty(IPropertySet.DESCRIPTION_KEY, "Description");
-
-
-
Returns:
- Description of the Property Set,
or
null
in case no description has been set.
setDescription
void setDescription(
String description)
- Sets the description property of the property set.
Fully equivalent to
addProperty(IPropertySet.DESCRIPTION_KEY, description);
-
-
-
Parameters:
-
description
- the string describing this property set.
getProperty
IProperty getProperty(
String key)
- Return the
IProperty
associated with the given key.
If the key is not in the set, null
is returned.
-
-
-
Parameters:
-
key
- String key for Property
-
Returns:
- requested Property,
or
null
if the key is not found in the set.
getPropertyValue
String getPropertyValue(
String key)
- Return the String representation of a Property.
Provided that the key is found in the set, this is a shortcut
for getProperty(key).getValue(). If the key is not in the set,
null
is returned.
-
-
-
Parameters:
-
key
- String key for Property
-
Returns:
- String value of requested Property,
or
null
if the key is not found in the set.
getPropertyKeys
String[] getPropertyKeys()
- Return the list of Property Keys in this Set.
Provided that the Set has a description, the
-
-
-
Returns:
- String array of Property keys.
getPropertyType
IPropertyType getPropertyType(
String key)
- Return the type of the property identified by the given key.
-
-
-
Parameters:
-
key
- String key for Property
-
Returns:
- Type of requested Property,
or
null
if the key is not found in the set.
setName
void setName(
String name)
- Set the name of this Property Set.
-
-
-
Parameters:
-
name
- the name to set. Must not be null
setProperties
void setProperties(
Map map)
- Set all the Properties of this set.
-
-
-
Parameters:
-
map
- a Map of String to
IProperty
associations.
addProperty
IProperty addProperty(
String key,
String value)
- Add a Property with String value to the set.
In case a Property already exist for the given key, it will be overwritten
by the new value, note that this will not change the Property's type,
so if the key identifies an integer Property but you set it to String value
"foo" the resulting Property Set will be inconsistent.
If the Property does not yet exist in the set, a new key will be added and
the new Property will be of type "String".
-
-
-
Parameters:
-
key
- Key to add -
value
- Value to add
-
Returns:
- The added Property
addProperty
IProperty addProperty(
String key,
String value,
IPropertyType type)
- Add a typed Property to the set.
In case a Property already exists for the given key, it will be
removed and replaced by the new one.
-
-
-
Parameters:
-
key
- Key to add -
value
- Value to add -
type
- Type of the Property to add
-
Returns:
- The added Property
removeProperty
boolean removeProperty(
String key)
- Remove a Property from the set.
-
-
-
Parameters:
-
key
- The key to remove
-
Returns:
-
true
if the Property has been removed,
or false
if the key has not been part of the set.
setContainer
void setContainer(
IPropertySetContainer container)
- Sets the container of this property set. Used to notify the container of
a change in a property.
-
-
-
Parameters:
-
container
- the property set container
getContainer
IPropertySetContainer getContainer()
-
-
-
Returns:
- the container of this property set or null if there is no container.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.