public interface InheritedConfigurationDescription
extends java.io.Serializable
ChangeableConfigurationDescription
but extends it by the means for inheritance. This allows to build hierarchies
of configuration descriptions that inherit and override configuration
entries. The inheritance of configuration descriptions is based on the
inheritance of the corresponding entities of the activity model, for instance
Operations and ExecutableComponentDescriptions.
Since an InheritedConfigurationDescription has a slightly
different semantic due to the inheritance and is only used in the activity
model, it is separated from the ConfigurationDescription
-class-hierarchy. removeInheritedEntry(String) which
sets the corresponding entry to null. This way the entry becomes
undefined. Undefining an entry is different from
removing the entry for this configuration
description which removes the overriding and inherits the value again.
When overriding, only the description, and the restrictions may be changed. Additionally, an
optional entry may be set to
mandatory - but not vice versa. Only optional entries may be overridden.
The name of an entry cannot be changed (directly) since the name identifies
an entry. To rename an entry anyway, remove the entry with the old name and
add the entry again as complete object with the new name.
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID
Generated ID for serialisation.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,ConfigurationDescription.ConfigurationEntry> |
getEntries()
Gets a map containing all entries for this configuration description
indexed by the name of the entry (
ConfigurationDescription.ConfigurationEntry.getName()). |
ConfigurationDescription.ConfigurationEntry |
getEntry(java.lang.String entryName)
Returns the configuration entry with the designated name or
null if
no entry with that name exists. |
boolean |
isEntryInherited(java.lang.String entryName)
Gets whether the entry with the designated name is inherited from the
parent configuration description, that is this configuration description
does not override the entry with the designated name of a parent entity.
|
boolean |
isOverridingEntry(java.lang.String entryName)
Gets whether the configuration entry with the designated name is actually
overriding the value from a parent description.
|
void |
overrideEntry(ConfigurationDescription.ConfigurationEntry entry)
Overrides an entry of the parent configuration description with the
designated one.
|
void |
removeEntry(java.lang.String name)
Removes the entry with the designated name from this configuration
description that overrides an entry from a parent entity.
|
void |
removeInheritedEntry(java.lang.String entryName)
Removes the entry with the designated name for the child entities, that is,
the entry is overridden and set to
null. |
void |
setEntry(ConfigurationDescription.ConfigurationEntry entry)
Adds or updates the designated configuration entry to/of this description.
|
static final long serialVersionUID
ConfigurationDescription.ConfigurationEntry getEntry(java.lang.String entryName)
null if
no entry with that name exists.entryName - The name of the configuration entry to return.null if no entry with that name
exists.java.util.Map<java.lang.String,ConfigurationDescription.ConfigurationEntry> getEntries()
ConfigurationDescription.ConfigurationEntry.getName()). This name
is also the key to retrieve the value from the appropriate
Configuration. isEntryInherited(String) should be
called to skip them if necessary. The map may contain null values (i.e.
there is an entry name without ConfigurationEntry); this allows to
prevent entries from being inherited. This is of course only allowed for
non-optional entries.void setEntry(ConfigurationDescription.ConfigurationEntry entry)
A configuration entry is identified by its name, therefore if an entry with the designated name already exists, an update will be performed, otherwise a new entry will be created. The name must neither be null nor the empty string.
entry - The new or changed configuration entry for this description.
Whether it is new or updated depends on the name of the entry.
When updating the type or restrictions of the entry, configuration
values of the corresponding configurations may be
removed. This must not have null or the empty string as name.void removeEntry(java.lang.String name)
name - The name of the configuration entry to remove from this
configuration description and to inherit from a parent entity
again. This must neither be null nor the empty string.boolean isEntryInherited(java.lang.String entryName)
entryName - The name of the configuration entry to check whether it is
overridden by this configuration description. This must neither be
null nor the empty string.boolean isOverridingEntry(java.lang.String entryName)
isEntryInherited(String).entryName - The name of the configuration entry to check whether it is
overridden by this description. This must neither be null nor
the empty string.void overrideEntry(ConfigurationDescription.ConfigurationEntry entry)
description, and the
restrictions may be changed as
well as an optional entry may be
set to mandatory.entry - The configuration entry providing new attributes for this
description. The entry must exist in a parent configuration
description and it may only override the description, restrictions
and it may be set to non-optional.void removeInheritedEntry(java.lang.String entryName)
null. The corresponding
entry has to exist in the parent configuration description and it has to be
optional. entryName - The name of the configuration entry that is removed for
the child entities. The entry must exist in a parent configuration
description and it must be optional.