Interface MTAttributeType

All Superinterfaces:
Comparable<MTNamedObject>, MTAttributeTypeHeader, MTHistoryEnabled, MTNamedObject

public interface MTAttributeType extends MTAttributeTypeHeader, MTHistoryEnabled
Full interface for attribute types. There can be one or more attribute types in a repository (there is always at least the default attribute type). These attribute types can then be connected to symbol types (or models) to determine the available attributes for a symbol or model. For more information about attributes and its types, see MTAttributeHeader.
Since:
5.0
See Also:
  • Method Details

    • setLastModified

      void setLastModified(Date lastModified)
      Overrides the last modified date of the type.
      Parameters:
      lastModified - The new last modified date.
      Since:
      5.0
    • setTitle

      void setTitle(String title)
      Sets the title in the current language.
      Parameters:
      title - The new title.
      Since:
      5.0
    • setTitle

      void setTitle(MTLanguageHeader language, String title)
      Sets the title in a given language.
      Parameters:
      language - The language to set the title in.
      title - The new title.
      Since:
      5.0
    • setRefinement

      void setRefinement(String refinement)
      Sets the refinement of this attribute type in the current language.
      Parameters:
      refinement - the new refinement
      Since:
      5.0
      See Also:
    • setRefinement

      void setRefinement(MTLanguageHeader language, String refinement)
      Sets the refinement of this attribute type in the given language.
      Parameters:
      language - The language
      refinement - The new refinement
      Since:
      5.0
      See Also:
    • setSummary

      void setSummary(String summary)
      Sets the summary in the current language.
      Parameters:
      summary - The new summary.
      Since:
      5.0
    • setSummary

      void setSummary(MTLanguageHeader language, String summary)
      Sets the summary in a given language.
      Parameters:
      language - The language to set the summary in.
      summary - The new summary.
      Since:
      5.0
    • setInputType

      void setInputType(String inputType)
      Sets the input type for this attribute type.
      Parameters:
      inputType - A string representation of the input type.
      See Also:
    • setDataType

      void setDataType(String dataType)
      Sets the data type of this attribute type.
      Parameters:
      dataType - A string representation of the data type.
      See Also:
    • setIconURL

      void setIconURL(URL iconURL)
      Sets the URL to the icon of the attribute type.
      Parameters:
      iconURL - the icon URL.
    • setVisibility

      void setVisibility(ModelType modelType, Type connectionType, boolean visible)
      Sets the visibility of this attribute type in the context of the model type when viewed as a connection to the connection type. After the fact comment: This property is mainly used to support filters where one wants to show attribute types based on some context. The only context is currently ModelType, meaning that a filter can be constructed so that in the context of "General model", the attribute type "Cost" is never shown for "Business objects". This method would make a lot more sense if the context was an arbitrary object (ie a string). That way, callers could use any context as a filter. As it is now, this method is only useful for UIs like the AttributeView (No, readers of this are not supposed to know about the AttributeView, but this comment makes no sense anywhere else). Simply put, this is bad API design (by me).
      Parameters:
      modelType - The context where the visibility applies.
      connectionType - The connected type to which the visibility applies.
      visible - True to make this attribute type's attributes visible in the given context when viewed as a connection to the given connection type, false to make it hidden.
      See Also:
    • isVisible

      boolean isVisible(ModelType modelType, Type connectionType)
      Returns true if this attribute type is connected to the connection type and is visible in the given model type, false otherwise. This method can be used to filter out which attributes to show for a given type (connectionType) in a given context (modelType).
      Parameters:
      modelType - The context where the attribute type's attributes are visible.
      connectionType - The connection for the attribute type.
      Returns:
      true if this attribute type is connected to the connection type and visible in the given model type, false otherwise.
      See Also:
    • isConnectedToModels

      boolean isConnectedToModels()
      Inspects if this attribute type is connected for models.
      Returns:
      true if this attribute type is connected for models, otherwise false.
      Since:
      5.0
    • getConnectedToModelPosition

      int getConnectedToModelPosition()
      Returns the position of this attribute type for Models. The behaviour of this method is unspecified if isConnectedToModels() returns false.
      Returns:
      the position of this attribute type for Models.
      Since:
      5.0
    • getConnectedSymbolTypes

      Map<SymbolType,Integer> getConnectedSymbolTypes()
      Returns all connected symbol types and its position for this attribute type. The behaviour of this method is unspecified if isConnectedToModels() returns true.
      Returns:
      all connected symbol types and its position for this attribute type.
      Since:
      5.0
    • connectToSymbolType

      void connectToSymbolType(SymbolType type)
      Connects this attribute type to a symbol type.
      Parameters:
      type - The symbol type to connect the attribute type to.
      Since:
      5.0
    • connectToSymbolType

      void connectToSymbolType(SymbolType type, int pos)
      Connects this attribute type to a symbol type and gives the attribute type the given position. The position will be used when editing attributes for symbols of the given symbol type, to order the editor-widgets for the attributes.
      Parameters:
      type - The symbol type to connect the attribute type to.
      pos - The position that editors for this attribute type should have relative to each other.
      Since:
      5.0
    • connectToModels

      void connectToModels()
      Connects this attribute type to models.
      Since:
      5.0
    • connectToModels

      void connectToModels(int pos)
      Connects this attribute type to models and gives the attribute type the given position. The position will be used when editing attributes for models, to order the editor-widgets for the attributes.
      Parameters:
      pos - The position that editors for this attribute type should have relative to each other.
      Since:
      5.0
    • removeFromSymbolType

      void removeFromSymbolType(SymbolType type)
      Removes this attribute type from a symbol type. All existing attributes of this type, connected to symbols of the given symbol type, will also be removed.
      Parameters:
      type - The symbol type to remove the attribute type from.
      Since:
      5.0
    • removeFromModels

      void removeFromModels()
      Removes this attribute type from models. All existing attributes of this type connected to models will be removed as well.
      Since:
      5.0
    • save

      void save() throws MTAccessException
      Saves a new attribute type or saves changes to an existing one.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • remove

      void remove() throws MTAccessException
      Removes this attribute type. This will remove the attribute type from all models and symbols that uses it and by extension all the attributes that has this attribute type.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • clearData

      void clearData() throws MTAccessException
      Clears (removes) all MTAttributes with this type as its attribute type.
      Throws:
      MTAccessException - If an MTAccessException occurs.