UML Modeling Guide

Stereotype «TypeRestriction»

Stereotype «TypeRestriction»

The «TypeRestriction» stereotype can be used to further restrict the allowed types within a polymorphic property to certain types.

This can be achieved either by defining an explicit list of allowed types via allowedTypes or by specifying types that are not permitted via notAllowedTypes. Only one of these options may be used at a time; they cannot be used simultaneously.


Stereotype «TypeRestriction»  
Applicable Elements Parameter Property Dependency  
Tagged Values    
Name Type Description
allowedTypes String Names of the types that are allowed (fully qualified name in Java notation).
notAllowedTypes String Names of the types that are not allowed (fully qualified name in Java notation).
allowSubtypes Boolean Tagged value defines if subtypes of the configured allowedTypes should be treated as a match as well. This flag has no effect on notAllowedTypes which are always matched using the exact runtime type.

If set to true (default) subclasses of a configured allowed type are treated the same way as the configured type itself. If set to false only objects whose exact runtime type matches one of the configured allowed types are taken into account, so subclasses of a configured type are not considered automatically.


Generated by JEAF Generator