com.microfocus.awm.meta.modelextension

## Class ModelExtensionUtilities

- java.lang.Object
- - com.microfocus.awm.meta.modelextension.ModelExtensionUtilities

-     public class ModelExtensionUtilities
      extends java.lang.Object

  Utility class for the AWM model extension point.

  Copyright Micro Focus GmbH.

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelExtensionUtilities()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ComplexAttributeExtension` | `getComplexAttribute(ComplexAttributeBase pCab)` Gets the `ComplexAttributeExtension` for the given `ComplexAttributeBase`.
    `static java.lang.String` | `getFullQualifiedID(ModelExtensionObject pExtensionObject, java.lang.String pLastQualifier)` Returns a full qualified ID using the ID of the given model extension object and appending the given last qualifier.
    `static FunctionPackage` | `getFunctionPackage(FunctionPackageExtension pFpe, TAURUSConfiguration pModel)` Gets the function package for the given extension from the model.
    `static FunctionPackageExtension` | `getFunctionPackage(ToolDescriptor pTd)` Gets the function package of the given tool descriptor.
    `static FunctionPackageExtension` | `getFunctionPackageExtension(FunctionPackage pPackage)` Gets the function package extension of a modelled function package.
    `static FunctionPackageExtension` | `getFunctionPackageExtension(java.lang.String pPackageId)` Gets the function package extension with the given ID.
    `static java.util.List<FunctionPackageExtension>` | `getFunctionPackageExtensions()` Lazy gets a list of all registered model extensions.
    `static java.util.List<FunctionPackageExtension>` | `getFunctionPackageExtensions(TaurusPackage pPackage)` Lazy gets a list of all registered model extensions.
    `static IconExtension` | `getIconExtension(java.lang.String pFunctionPackageIconID)` Gets the icon extension for the given ID.
    `static java.util.List<IconExtension>` | `getIconExtensions()` Gets a list of all available icon extensions.
    `static LinkedElementTypeExtension` | `getLinkedElementTypeExtension(java.lang.String pLinkedElementTypeID)` Gets the linked element type extension with the given ID.
    `static java.util.Collection<LinkedElementTypeExtension>` | `getLinkedElementTypeExtensions()` Gets all registered linked element type extensions.
    `static ModelExtensionObject` | `getModelExtensionObject(DynamicObject pDynObj)` Gets the model extension object for a dynamic EObject.
    `static ModelExtensionObject` | `getModelExtensionObject(java.lang.String pExtensionID)` Gets the model extension object for an ID.
    `static ModelExtensionWithAttributes` | `getModelExtensionWithAttributes(org.eclipse.emf.ecore.EObject pDynamicObject)` Gets the `ModelExtensionWithAttributes` for the given `DynamicObject`.
    `static java.util.Collection<PreDefinedModelExtensionObject>` | `getPreDefinedObjectExtensions(org.eclipse.emf.ecore.EClass pEClass)` Gets all available `PreDefinedModelExtensionObject`s for the desired `EClass`.
    `static java.util.Collection<PreDefinedModelExtensionObject>` | `getPreDefinedObjectExtensions(org.eclipse.emf.ecore.EClass pEClass, java.util.List<FunctionPackage> pDesiredFunctionPackages)` Gets all available `PreDefinedModelExtensionObject`s for the desired `EClass` and function packages.
    `static java.util.List<PropertyProviderExtension>` | `getPropertyProviderExtensions()` Gets a list of all available property provider extensions.
    `static ToolTypeExtension` | `getToolType(ToolDescriptor pTd)` Gets the `ToolTypeExtension` of the given tool descriptor.
    `static ToolTypeParameter` | `getToolTypeParameter(RToolParameter pTp)` Gets the `ToolTypeParameter` of the given tool type parameter.
    `static java.util.List<ToolTypeExtension>` | `getToolTypes()` Gets a list of available tool type extensions.

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

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

- - ### Constructor Detail

    - #### ModelExtensionUtilities

          public ModelExtensionUtilities()

  - ### Method Detail

    - #### getToolType

          public static ToolTypeExtension getToolType(ToolDescriptor pTd)

      Gets the `ToolTypeExtension` of the given tool descriptor. Returns `null` if it cannot be found.
      Parameters:
        `pTd` - a tool descriptor
      Returns:
        the tool descriptors tool type or `null`

    - #### getToolTypeParameter

          public static ToolTypeParameter getToolTypeParameter(RToolParameter pTp)

      Gets the `ToolTypeParameter` of the given tool type parameter. Returns `null` if it cannot be found.
      Parameters:
        `pTp` - a `RToolParameter`
      Returns:
        the tool descriptors tool type or `null`

    - #### getComplexAttribute

          public static ComplexAttributeExtension getComplexAttribute(ComplexAttributeBase pCab)

      Gets the `ComplexAttributeExtension` for the given `ComplexAttributeBase`.
      Parameters:
        `pCab` - the complex attribute base (model editor object)
      Returns:
        the complex attribute (extension definition) or `null`

    - #### getModelExtensionWithAttributes

          public static ModelExtensionWithAttributes getModelExtensionWithAttributes(org.eclipse.emf.ecore.EObject pDynamicObject)

      Gets the `ModelExtensionWithAttributes` for the given `DynamicObject`.
      Parameters:
        `pDynamicObject` - the `DynamicObject`
      Returns:
        the tool type component or `null`

    - #### getFunctionPackageExtension

          public static FunctionPackageExtension getFunctionPackageExtension(FunctionPackage pPackage)

      Gets the function package extension of a modelled function package.
      Parameters:
        `pPackage` - the package from the model
      Returns:
        the function package extension or `null`

    - #### getModelExtensionObject

          public static ModelExtensionObject getModelExtensionObject(DynamicObject pDynObj)

      Gets the model extension object for a dynamic EObject.
      Parameters:
        `pDynObj` - the dynamic object
      Returns:
        the model extension object or `null`

    - #### getFunctionPackage

          public static FunctionPackageExtension getFunctionPackage(ToolDescriptor pTd)

      Gets the function package of the given tool descriptor.
      Parameters:
        `pTd` - the tool descriptor
      Returns:
        a function package or `null`

    - #### getFullQualifiedID

          public static java.lang.String getFullQualifiedID(ModelExtensionObject pExtensionObject,
                                                            java.lang.String pLastQualifier)

      Returns a full qualified ID using the ID of the given model extension object and appending the given last qualifier.
      Parameters:
        `pExtensionObject` - the model extension object
        `pLastQualifier` - the last ID qualifier
      Returns:
        a fully qualified identifier

    - #### getFunctionPackageExtensions

          public static java.util.List<FunctionPackageExtension> getFunctionPackageExtensions()

      Lazy gets a list of all registered model extensions. Uses extension point .
      Returns:
        a list of function package extensions
      See Also:
        `ModelExtensionParser.getFunctionPackageExtensions()`

    - #### getFunctionPackageExtensions

          public static java.util.List<FunctionPackageExtension> getFunctionPackageExtensions(TaurusPackage pPackage)

      Lazy gets a list of all registered model extensions. Uses extension point .
      Parameters:
        `pPackage` - the `TaurusPackage` instance
      Returns:
        a list of function package extensions
      See Also:
        `ModelExtensionParser.getFunctionPackageExtensions()`

    - #### getFunctionPackage

          public static FunctionPackage getFunctionPackage(FunctionPackageExtension pFpe,
                                                           TAURUSConfiguration pModel)

      Gets the function package for the given extension from the model. Returns `null` if the function package is not defined in the model.
      Parameters:
        `pFpe` - the function package extension
        `pModel` - the model to search the package in
      Returns:
        the function package or `null` if it doesn't exist in the model

    - #### getToolTypes

          public static java.util.List<ToolTypeExtension> getToolTypes()

      Gets a list of available tool type extensions. Uses the extension point .
      Returns:
        a list of tool type extensions
      See Also:
        `ModelExtensionParser.getToolExecutorExtensions()`, `ModelExtensionParser.getToolTypes()`

    - #### getPropertyProviderExtensions

          public static java.util.List<PropertyProviderExtension> getPropertyProviderExtensions()

      Gets a list of all available property provider extensions.
      Returns:
        all property provider extensions

    - #### getLinkedElementTypeExtension

          public static LinkedElementTypeExtension getLinkedElementTypeExtension(java.lang.String pLinkedElementTypeID)

      Gets the linked element type extension with the given ID.
      Parameters:
        `pLinkedElementTypeID` - the ID of a linked element type extension
      Returns:
        the linked element type extension or `null` if it does not exist

    - #### getLinkedElementTypeExtensions

          public static java.util.Collection<LinkedElementTypeExtension> getLinkedElementTypeExtensions()

      Gets all registered linked element type extensions.
      Returns:
        a collection of all registered linked element type extensions

    - #### getFunctionPackageExtension

          public static FunctionPackageExtension getFunctionPackageExtension(java.lang.String pPackageId)

      Gets the function package extension with the given ID.
      Parameters:
        `pPackageId` - the ID of the function package extension
      Returns:
        the function package extension or `null` if no extension with the given ID exists

    - #### getIconExtensions

          public static java.util.List<IconExtension> getIconExtensions()

      Gets a list of all available icon extensions.
      Returns:
        all icon extensions

    - #### getIconExtension

          public static IconExtension getIconExtension(java.lang.String pFunctionPackageIconID)

      Gets the icon extension for the given ID.
      Parameters:
        `pFunctionPackageIconID` - the full qualified icon extension ID
      Returns:
        the icon extension or `null`

    - #### getModelExtensionObject

          public static ModelExtensionObject getModelExtensionObject(java.lang.String pExtensionID)

      Gets the model extension object for an ID.
      Parameters:
        `pExtensionID` - the ID of the model extension object
      Returns:
        the model extension object or `null`

    - #### getPreDefinedObjectExtensions

          public static java.util.Collection<PreDefinedModelExtensionObject> getPreDefinedObjectExtensions(org.eclipse.emf.ecore.EClass pEClass)

      Gets all available `PreDefinedModelExtensionObject`s for the desired `EClass`.

      Same as calling `getPreDefinedObjectExtensions(EClass, null)`.

      Parameters:
        `pEClass` - the desired `EClass`
      Returns:
        a collection of pre-defined model extensions. Can be empty.

    - #### getPreDefinedObjectExtensions

          public static java.util.Collection<PreDefinedModelExtensionObject> getPreDefinedObjectExtensions(org.eclipse.emf.ecore.EClass pEClass,
                                                                                                           java.util.List<FunctionPackage> pDesiredFunctionPackages)

      Gets all available `PreDefinedModelExtensionObject`s for the desired `EClass` and function packages.
      Parameters:
        `pEClass` - the desired `EClass`
        `pDesiredFunctionPackages` - a collection of desired function packages. Extensions of other function packages will be ignored. Can be `null` to not filter for function packages and return all applicable extensions.
      Returns:
        a collection of pre-defined model extensions. Can be empty.

Copyright © 2015 Micro Focus GmbH. All rights reserved.