Class TypeDescriptionSource


  • public class TypeDescriptionSource
    extends Object
    DTO/data collector for the mutable type description being based on some existing type instance. Allows to expand the type set of the given type in a safe manner without a significant overhead of type cloning
    • Constructor Detail

      • TypeDescriptionSource

        public TypeDescriptionSource()
        Constructs an empty instance of the source
    • Method Detail

      • containsTypeItem

        public boolean containsTypeItem​(String typeName)
        Checks if this TypeDescriptionSource contains the type item with the given name. Null-safe variant
        Parameters:
        typeName - The name of the required TypeItem. May be null
        Returns:
        True if the corresponding type item is found
      • getBinaryQualifiers

        public BinaryQualifiers getBinaryQualifiers()
        Gets the binary qualifiers. The qualifiers are returned as-is, so one should clone them in case of other type insertion, etc
        Returns:
        The binary qualifiers. May be null
      • getDateQualifiers

        public DateQualifiers getDateQualifiers()
        Gets the date qualifiers. The qualifiers are returned as-is, so one should clone them in case of other type insertion, etc
        Returns:
        The date qualifiers. May be null
      • getFirstTypeItem

        public TypeItem getFirstTypeItem()
        Gets the first type item, if any
        Returns:
        The first TypeItem if any. null otherwise
      • getNumberQualifiers

        public NumberQualifiers getNumberQualifiers()
        Gets the number qualifiers. The qualifiers are returned as-is, so one should clone them in case of other type insertion, etc
        Returns:
        The number qualifiers. May be null
      • getResolvedTypes

        public Collection<Type> getResolvedTypes​(org.eclipse.emf.ecore.EObject context)
        Gets the collection of resolved type items, with typesets being taken into the account
        Parameters:
        context - The context object to use for the resolution. May not be null
        Returns:
        The collection of resolved types. Never null
      • getStringQualifiers

        public StringQualifiers getStringQualifiers()
        Gets the string qualifiers. The qualifiers are returned as-is, so one should clone them in case of other type insertion, etc
        Returns:
        The string qualifiers. May be null
      • getTypeInfoCount

        public int getTypeInfoCount()
        Gets the number of type infos for this type source
        Returns:
        The number of type infos
      • getTypes

        public List<TypeItem> getTypes()
        Gets the current set of type items
        Returns:
        The type items of this source. May not be null
      • toTypeDescription

        public TypeDescription toTypeDescription()
        Creates a corresponding type description ready for insertion into any model (with cloning, etc)
        Returns:
        The final type descrion. May not be null
      • isEmpty

        public boolean isEmpty()
        Checks if there are no type items associated with this source
        Returns:
        True if the type source is empty
      • merge

        public TypeDescriptionSource merge​(TypeDescription type)
        Merges the given TypeDescription into the current source. The current source is being modified as a result of the operation
        Parameters:
        type - The type to merge. May be null
        Returns:
        The resulting type. Never null