@OpenApiAll
public class SmartListenerConfig
extends java.lang.Object
Smart listener configuration describes how to reach a specific property in the model from a given model element. Smart listener uses the configuration to create a chain of properties through which listener events map.
This class also contains predefined smart listener configurations which can be widely reused. Reusable smart listener configurations cannot be modified.
Modifier and Type | Field and Description |
---|---|
static SmartListenerConfig |
APPLIED_STEREOTYPE_CONFIG
Listen to the applied stereotype instance.
|
static SmartListenerConfig |
COMBINED_FRAGMENT_CONFIG
Listens to combined fragment.
|
static SmartListenerConfig |
CONVEYED_INFORMATION_CONFIG
Listens to conveyed information.
|
static SmartListenerConfig |
DIAGRAM_CONTEXT_CONFIG
Listens to diagram context.
|
static SmartListenerConfig |
INSTANCE_SLOT_VALUE_CONFIG
Listen to the slot value of the applied stereotype instance.
|
static SmartListenerConfig |
INSTANCE_SPECIFICATION_CLASSIFIER_CONFIG
Listens to instance specification classifier.
|
static SmartListenerConfig |
MESSAGE_CONFIG
Listens to the message.
|
static SmartListenerConfig |
MESSAGE_SIGNATURE_CONFIG
Listens to message signature.
|
static SmartListenerConfig |
MULTIPLICITY_CONFIG
Listens to the multiplicity.
|
static SmartListenerConfig |
NAME_CONFIG
Listen to the name of the element.
|
static SmartListenerConfig |
PARAMETER_SUBSTITUTION_CONFIG
Listens to parameter substitution.
|
static SmartListenerConfig |
QUALIFIED_NAME_CONFIG
Listen to the qualified name of the element.
|
static SmartListenerConfig |
SLOT_VALUE_CONFIG
Listen to the value of the slot.
|
static SmartListenerConfig |
STEREOTYPE_AND_QNAME_CONFIG
Listen to the stereotype and qualified name.
|
static SmartListenerConfig |
STEREOTYPE_AND_TAGS_CONFIG
Listens to stereotypes and tag values.
|
static SmartListenerConfig |
STEREOTYPE_AND_TAGS_INSTANCE_SPECIFICATION_CONFIG
Listens to stereotype and tags for applied instance specification.
|
static SmartListenerConfig |
STEREOTYPE_CONFIG
Listen to the applied stereotype.
|
static SmartListenerConfig |
STEREOTYPE_INSTANCE_SPECIFICATION_CONFIG
Listens to instance specification stereotype.
|
static SmartListenerConfig |
STEREOTYPE_METACLASS_CONFIG
Listen to the metaclass of a stereotype.
|
static SmartListenerConfig |
TRANSITION_CONFIG
Listens to transition.
|
static SmartListenerConfig |
TRIGGER_CONFIG
Listens to trigger.
|
static SmartListenerConfig |
VALUE_SPECIFICATION_CONFIG
Listen to the value specification.
|
Constructor and Description |
---|
SmartListenerConfig()
Constructs the configuration.
|
SmartListenerConfig(java.util.Map<java.lang.String,SmartListenerConfig> references)
Constructs smart listener config.
|
SmartListenerConfig(java.lang.String propertyName)
Constructs the configuration with a property name.
|
SmartListenerConfig(java.lang.String propertyName,
SmartListenerConfig config)
Constructs the configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(SmartListenerConfig config)
Makes a shallow copy of the passed config to this config.
|
static SmartListenerConfig |
createBehaviorsConfig()
Creates a smart listener config for listening to owned behaviors in the classifier hierarchy.
|
static SmartListenerConfig |
createEventConfig()
Creates event config.
|
static SmartListenerConfig |
createMessageSignature()
Creates listener for message signature.
|
static SmartListenerConfig |
createSignalConfig()
Creates signal config.
|
void |
deepCopy(SmartListenerConfig config)
Deep copies a passed config to this config.
|
void |
dump()
Dumps property configuration to the standard output.
|
SmartListenerConfig |
getPropertyConfig(java.lang.String propertyName)
Gets property config which is used for a particular property.
|
java.util.Map<java.lang.String,SmartListenerConfig> |
getReferences()
Gets references of this configuration.
|
static void |
initStereotypeAndTagsInstanceSpecificationConfig(SmartListenerConfig stereotypeAndTagsInstanceSpecificationConfig,
SmartListenerConfig slotConfig)
Initializes stereotypes and tags instance specification config.
|
static void |
initValueSpecificationConfig(SmartListenerConfig valueSpecificationConfig)
Initializes value specification config.
|
static void |
initValueSpecificationConfig(SmartListenerConfig valueSpecificationConfig,
SmartListenerConfig elementConfig)
Initializes value specification config.
|
SmartListenerConfig |
listenTo(java.util.Collection propertyNames)
Listens to given property names.
|
SmartListenerConfig |
listenTo(java.lang.String propertyName)
Listens to a given property name.
|
SmartListenerConfig |
listenTo(java.lang.String referenceName,
SmartListenerConfig config)
Listens to a given property and passes a smart listener configuration for it to
apply if references are found among property values.
|
SmartListenerConfig |
listenTo2(java.lang.String referenceName,
SmartListenerConfig config)
Deprecated.
use
listenTo(String, SmartListenerConfig) , because it merges configs too. |
SmartListenerConfig |
listenToNested(java.lang.String propertyName)
Listens to a nested property configuration.
|
void |
makeUnmodifiable()
Make config unmodifiable.
|
public static final SmartListenerConfig NAME_CONFIG
public static final SmartListenerConfig QUALIFIED_NAME_CONFIG
public static final SmartListenerConfig VALUE_SPECIFICATION_CONFIG
public static final SmartListenerConfig SLOT_VALUE_CONFIG
public static final SmartListenerConfig INSTANCE_SLOT_VALUE_CONFIG
public static final SmartListenerConfig APPLIED_STEREOTYPE_CONFIG
public static final SmartListenerConfig STEREOTYPE_METACLASS_CONFIG
public static final SmartListenerConfig STEREOTYPE_CONFIG
public static SmartListenerConfig STEREOTYPE_AND_QNAME_CONFIG
public static final SmartListenerConfig STEREOTYPE_AND_TAGS_CONFIG
public static final SmartListenerConfig PARAMETER_SUBSTITUTION_CONFIG
public static final SmartListenerConfig TRIGGER_CONFIG
public static final SmartListenerConfig TRANSITION_CONFIG
public static SmartListenerConfig MESSAGE_SIGNATURE_CONFIG
public static final SmartListenerConfig MESSAGE_CONFIG
public static final SmartListenerConfig COMBINED_FRAGMENT_CONFIG
public static final SmartListenerConfig CONVEYED_INFORMATION_CONFIG
public static final SmartListenerConfig STEREOTYPE_AND_TAGS_INSTANCE_SPECIFICATION_CONFIG
public static final SmartListenerConfig DIAGRAM_CONTEXT_CONFIG
public static final SmartListenerConfig MULTIPLICITY_CONFIG
public static final SmartListenerConfig STEREOTYPE_INSTANCE_SPECIFICATION_CONFIG
public static final SmartListenerConfig INSTANCE_SPECIFICATION_CLASSIFIER_CONFIG
public SmartListenerConfig()
public SmartListenerConfig(java.lang.String propertyName)
propertyName
- property name to use as a reference.public SmartListenerConfig(java.lang.String propertyName, SmartListenerConfig config)
propertyName
- property name to use as a reference.config
- config to use with a property reference.public SmartListenerConfig(java.util.Map<java.lang.String,SmartListenerConfig> references)
references
- references to use.public static void initStereotypeAndTagsInstanceSpecificationConfig(SmartListenerConfig stereotypeAndTagsInstanceSpecificationConfig, SmartListenerConfig slotConfig)
stereotypeAndTagsInstanceSpecificationConfig
- config to initialize.slotConfig
- slot config with which to initialize.public static void initValueSpecificationConfig(SmartListenerConfig valueSpecificationConfig)
valueSpecificationConfig
- config to initialize.public static void initValueSpecificationConfig(SmartListenerConfig valueSpecificationConfig, SmartListenerConfig elementConfig)
valueSpecificationConfig
- config to initialize.elementConfig
- element config to use.public static SmartListenerConfig createEventConfig()
public static SmartListenerConfig createSignalConfig()
public static SmartListenerConfig createMessageSignature()
public static SmartListenerConfig createBehaviorsConfig()
public void makeUnmodifiable()
Make config unmodifiable. This means that new references can not be added or existing can not be changed. Any attempt to change unmodifiable config will end up with runtime exception.
public void copy(SmartListenerConfig config)
config
- passed configuration for copying.public void deepCopy(SmartListenerConfig config)
config
- config to copy.public java.util.Map<java.lang.String,SmartListenerConfig> getReferences()
public SmartListenerConfig getPropertyConfig(java.lang.String propertyName)
propertyName
- property for which to get property config.public SmartListenerConfig listenTo(java.lang.String referenceName, @CheckForNull SmartListenerConfig config)
referenceName
- property name for which configuration should be applied.config
- passed configuration for the property. If for a given property an existing
configuration is found, the two configurations will be merged and the merged
configuration will be stored.@Deprecated public SmartListenerConfig listenTo2(java.lang.String referenceName, SmartListenerConfig config)
listenTo(String, SmartListenerConfig)
, because it merges configs too.listenTo(String, SmartListenerConfig)
.
Only if founds already registered property
doesn't emit warning, but makes merge with already registered configuration. If configurations are merged, then
passed config
VALUE is replaced with a contents of merge result.referenceName
- property name for which configuration is applicableconfig
- passed configuration. It's VALUE will be edited if another configuration will be found already
registered by given reference name. VALUE of passed reference will be changed to the merged onepublic SmartListenerConfig listenTo(java.lang.String propertyName)
propertyName
- property name ot listen to.public SmartListenerConfig listenTo(java.util.Collection propertyNames)
propertyNames
- property names to listen to.public SmartListenerConfig listenToNested(java.lang.String propertyName)
propertyName
- property name to listen to.public void dump()