com.microfocus.awm.meta.util

## Class TaurusMetaModelUtilities

- java.lang.Object
- - com.microfocus.awm.meta.util.TaurusMetaModelUtilities

-     public class TaurusMetaModelUtilities
      extends java.lang.Object

  AWM meta model helper methods.
  Author:
    RalfP

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `METADATA_ANNOTATION_URI` Annotation URI used in ecore file to specify additional AWM specific meta data.
    `static java.lang.String` | `METADATAKEY_AWMTYPE` Key for the "AWM type" attribute which is used to specific attribute types which have e.g.
    `static java.lang.String` | `METADATAKEY_HELPCONTEXTID` Key for the "help context id" annotation which is used to show the help content when F1 help is invoked with the object selected in the model editor.
    `static java.lang.String` | `METADATAKEY_TOOL_EXECUTOR_VERSION` The tool execution interface version an attribute or object is relevant for.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaurusMetaModelUtilities()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Collection<?>` | `getAvailableToolTypes()` Deprecated. tool types are not used anymore with the introduction of function packages
    `static org.eclipse.emf.ecore.EAnnotation` | `getAWMMetaDataAnnotation(org.eclipse.emf.ecore.EModelElement pElement)` Attempts to get the AWM meta data annotation from an EModelElement.
    `static java.lang.String` | `getAWMMetadataAnnotationValue(org.eclipse.emf.ecore.EModelElement pElement, java.lang.String pKey)` Gets an annotation value of the AWM meta data annotation.
    `static org.eclipse.emf.ecore.EClass` | `getBaseEClass(org.eclipse.emf.ecore.EClass pEClass)` Gets the `EClass` of the first non-dynamic super class.
    `static java.lang.String` | `getBaseEClassName(org.eclipse.emf.ecore.EObject pEObject)` Gets the `EClass` name of the first non-dynamic super class.
    `static org.eclipse.emf.ecore.EStructuralFeature` | `getIDFeature(org.eclipse.emf.ecore.EObject pObject)` Gets the "iD" feature for the given object (if available).
    `static IFunctionPackageDefinable` | `getObjectWithExtensionID(java.lang.String pExtensionID, java.util.Collection<org.eclipse.emf.ecore.EObject> pObjectToCheck)` Returns the first object in the given list which contains the desired extension ID.
    `static java.util.Collection<Property>` | `getPropertiesFromStructure(IStructure pStructure)` Returns a collection of all `Property`s which are referenced in an `IStructure` by parsing all subcomponents (`IStructure.getComponents()` / `IStructureComponent.getChildren()`).
    `static org.eclipse.emf.ecore.EStructuralFeature` | `getSequenceNumberFeature(org.eclipse.emf.ecore.EObject pObject)` Gets the "seqNo" feature for the given object (if available).
    `static boolean` | `isTaurusForEclipseInstalled()` Deprecated. only used by deprecated features. Might be removed or not work in the future.
    `static java.lang.String` | `trimAndRemoveQuotes(java.lang.String pString)` Trims the string and removes surrounding quotes.
    `static boolean` | `validateSelectionCount(java.lang.String pSelCountCond)` Validates whether the selection count string is valid.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### METADATA_ANNOTATION_URI

          public static final java.lang.String METADATA_ANNOTATION_URI

      Annotation URI used in ecore file to specify additional AWM specific meta data.
      See Also:
        Constant Field Values

    - #### METADATAKEY_AWMTYPE

          public static final java.lang.String METADATAKEY_AWMTYPE

      Key for the "AWM type" attribute which is used to specific attribute types which have e.g. different presentations in the model editor.
      See Also:
        Constant Field Values

    - #### METADATAKEY_HELPCONTEXTID

          public static final java.lang.String METADATAKEY_HELPCONTEXTID

      Key for the "help context id" annotation which is used to show the help content when F1 help is invoked with the object selected in the model editor.
      See Also:
        Constant Field Values

    - #### METADATAKEY_TOOL_EXECUTOR_VERSION

          public static final java.lang.String METADATAKEY_TOOL_EXECUTOR_VERSION

      The tool execution interface version an attribute or object is relevant for.

      With AWM V5.0 a new tool execution interface has been introduced, which rendered many tool descriptor and tool parameter attributes deprecated (most of them have been deprecated before). This annotation controls whether attributes of `ToolDescriptor`s or `RToolParameter`s should be displayed in the model editor, depending on the annotation value.

      Currently there are two three possible annotation states:

      1. None - The attribute will always be displayed.
      2. `1` - The attribute will be displayed for tool descriptors (and parameters) implementing the old execution interface.
      3. `2` - The attribute will be displayed for tool descriptors (and parameters) implementing the new execution interface.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TaurusMetaModelUtilities

          public TaurusMetaModelUtilities()

  - ### Method Detail

    - #### isTaurusForEclipseInstalled

          @Deprecated
          public static boolean isTaurusForEclipseInstalled()

      Deprecated. only used by deprecated features. Might be removed or not work in the future.
      Checks whether AWM for Eclipse is installed.
      Returns:
        `true` if the AWM for Eclipse bundle is installed

    - #### getAvailableToolTypes

          @Deprecated
          public static java.util.Collection<?> getAvailableToolTypes()

      Deprecated. tool types are not used anymore with the introduction of function packages
      Gets a list of all available tool types.
      Returns:
        a list of all available tool type IDs

    - #### trimAndRemoveQuotes

          public static java.lang.String trimAndRemoveQuotes(java.lang.String pString)

      Trims the string and removes surrounding quotes.

      Example:
      `"abc"`
      Will be returned as
      `abc`

      Parameters:
        `pString` - the string to be trimmed
      Returns:
        the trimmed string

    - #### validateSelectionCount

          public static boolean validateSelectionCount(java.lang.String pSelCountCond)

      Validates whether the selection count string is valid.
      Parameters:
        `pSelCountCond` - the selection count attribute of an enabled condition.
      Returns:
        `true` if the given selection count attribute is valid.
      See Also:
        `ISelectionCondition.getSelectionCount()`

    - #### getSequenceNumberFeature

          public static org.eclipse.emf.ecore.EStructuralFeature getSequenceNumberFeature(org.eclipse.emf.ecore.EObject pObject)

      Gets the "seqNo" feature for the given object (if available).
      Parameters:
        `pObject` - the object to get the sequence number feature from
      Returns:
        the "seqNo" feature or `null` if the given object does not contain it (or is `null` itself)

    - #### getIDFeature

          public static org.eclipse.emf.ecore.EStructuralFeature getIDFeature(org.eclipse.emf.ecore.EObject pObject)

      Gets the "iD" feature for the given object (if available).
      Parameters:
        `pObject` - the object to get the ID feature from
      Returns:
        the "iD" feature or `null` if the given object does not contain it (or is `null` itself)

    - #### getBaseEClassName

          public static java.lang.String getBaseEClassName(org.eclipse.emf.ecore.EObject pEObject)

      Gets the `EClass` name of the first non-dynamic super class. Returns the given classe's name, if it's not dynamic.
      Parameters:
        `pEObject` - the object to get the base EClass name from
      Returns:
        the name of the next non-dynamic EClass in the classe's super type hierarchy
      See Also:
        `DynamicAWMPackage`, `EClass.getESuperTypes()`

    - #### getBaseEClass

          public static org.eclipse.emf.ecore.EClass getBaseEClass(org.eclipse.emf.ecore.EClass pEClass)

      Gets the `EClass` of the first non-dynamic super class. Returns the given class, if it's not dynamic.
      Parameters:
        `pEClass` - the class to get the base class from
      Returns:
        the next non-dynamic EClass in the classe's super type hierarchy
      See Also:
        `DynamicAWMPackage`, `EClass.getESuperTypes()`

    - #### getObjectWithExtensionID

          public static IFunctionPackageDefinable getObjectWithExtensionID(java.lang.String pExtensionID,
                                                                           java.util.Collection<org.eclipse.emf.ecore.EObject> pObjectToCheck)

      Returns the first object in the given list which contains the desired extension ID. Note that each extension ID must only occur once in a single model.
      Parameters:
        `pExtensionID` - the extension ID to check
        `pObjectToCheck` - a collection of objects to check
      Returns:
        the found object or `null` if none of the given objects has the desired extension ID
      See Also:
        `IFunctionPackageDefinable.getExtensionID()`

    - #### getPropertiesFromStructure

          public static java.util.Collection<Property> getPropertiesFromStructure(IStructure pStructure)

      Returns a collection of all `Property`s which are referenced in an `IStructure` by parsing all subcomponents (`IStructure.getComponents()` / `IStructureComponent.getChildren()`).
      Parameters:
        `pStructure` - the `IStructure` which should be parsed for the `Property`s
      Returns:
        a `Collection` containing all `Property`s referenced in the subcomponents of the `IStructure`.

    - #### getAWMMetaDataAnnotation

          public static org.eclipse.emf.ecore.EAnnotation getAWMMetaDataAnnotation(org.eclipse.emf.ecore.EModelElement pElement)

      Attempts to get the AWM meta data annotation from an EModelElement.
      Parameters:
        `pElement` - the element to get the annotation from
      Returns:
        the annotation or `null` if the element does not have it
      See Also:
        `METADATA_ANNOTATION_URI`

    - #### getAWMMetadataAnnotationValue

          public static java.lang.String getAWMMetadataAnnotationValue(org.eclipse.emf.ecore.EModelElement pElement,
                                                                       java.lang.String pKey)

      Gets an annotation value of the AWM meta data annotation.
      Parameters:
        `pElement` - the element to get the annotation from
        `pKey` - the desired annotation value key
      Returns:
        the annotation value or `null` if the key is not defined or no AWM meta data annotation is defined for the element
      See Also:
        `getAWMMetaDataAnnotation(EModelElement)`

Copyright © 2015 Micro Focus GmbH. All rights reserved.