com.microfocus.awm.core

## Class TaurusFactory

- java.lang.Object
- - com.microfocus.awm.core.TaurusFactory

-     public class TaurusFactory
      extends java.lang.Object

  Factory class for creating most model based objects and getting singleton instances of AWM directory classes.
  Author:
    Micro Focus

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearMaps()` Clears internal cache maps.
    `static IExecutionContext` | `createAttributeContext(DynamicObject pDynObj)` Create a context with dynamic attributes of the tool descriptor.
    `IElement` | `createElement(java.lang.String pElementId, ElementType pElementTyp)` Creates a new element.
    `IElementList` | `createElementList(ElementListStructure pElementListStructure, ActionDescriptor pAction)` Same as calling `createElementList(ElementListStructure, ActionDescriptor, null, null)`.
    `IElementList` | `createElementList(ElementListStructure pElementListStructure, ActionDescriptor pAction, java.lang.String pElementListID)` Same as calling `createElementList(ElementListStructure, ActionDescriptor, String, null)`.
    `IElementList` | `createElementList(ElementListStructure pElementListStructure, ActionDescriptor pAction, java.lang.String pElementListID, IResource pParent)` Creates an `IElementList` depending on the given parent `IResource`.
    `IElementListEntry` | `createElementListEntry(IElementList pElementList, java.lang.String pElementId, ElementType pElementTyp)` Creates a new element list entry.
    `IElementListEntry` | `createElementListEntry(IElementList pElementList, java.lang.String pElementId, ElementType pElementTyp, int pState)` Creates a new element list entry.
    `IElementListEntry` | `createElementListEntry(IElementList pElementList, java.lang.String pElementListEntryID, IElement pElement)` Creates a new element list entry.
    `IElementListKey` | `createElementListKey(ActionDescriptor pAction, IResource pResource)` Creates an element list key.
    `IErrorFeedbackEntry` | `createErrorFeedbackEntry()` Creates a new empty error feedback entry.
    `IErrorFeedbackEntry` | `createErrorFeedbackEntry(java.lang.String pFileName, java.lang.String pMsgText, java.lang.String pMsgNUMBER, java.lang.String pMsgLine, IElement pResource)` Creates an error feedback entry.
    `IErrorFeedbackEntry` | `createErrorFeedbackEntry(java.lang.String pFileName, java.lang.String pMsgText, java.lang.String pMsgNUMBER, java.lang.String pMsgLine, IElement pResource, java.util.Map<java.lang.String,java.lang.String> pCustomFileAttributes, java.util.Map<java.lang.String,java.lang.String> pCustomMessageAttributes)` Creates an error feedback entry.
    `IExecutionContext` | `createExecutionContext(ISystemImage pTaurusSystem)` Creates a basic execution context.
    `IExecutionContext` | `createExecutionContext(ISystemImage pSys, ActionDescriptor pActionDescriptor)` Creates an execution context.
    `FileDescriptor` | `createFileDescriptor()` Creates a new `FileDescriptor`.
    `IFileResource` | `createFileResource(FileDescriptor pFD)` Creates a simple file resource for the given file descriptor.
    `IFilter` | `createFilter(FilterType pFilterType, java.lang.String pID)` Creates a new filter.
    `static IFunctionPackage` | `createFunctionPackage(FunctionPackage pFunctionPackage)` Creates a new `IFunctionPackage` to wrap the `FunctionPackage` model object.
    `static IToolInputParameter` | `createInputParameter(RToolInParameter pRToolInParameter, IToolContext pToolContext)` Creates a new `IToolInputParameter` instance based on the provided `RToolInParameter` and `IToolContext`.
    `IToolExecutor` | `createIntegratedToolExecutor()` Deprecated. the `IntegratedToolExecuter` is based on the legacy tool interface `IToolExecutor` which should no longer be used. Use the `IToolExecutor2` interface instead.
    `ITaurusJob` | `createJob(java.lang.String pJobID)` Creates a new Taurus job.
    `ITaurusJob` | `createJob(java.lang.String pJobID, java.lang.String pCacheID)` Creates a new Taurus job.
    `IPropertyValue` | `createLinkedPropertyValue(LinkedProperty pProp, IExecutionContext pContext)` Creates a property value for linked properties.
    `static IModeledToolOutputParameter` | `createOutputParameter(RToolOutParameter pRToolOutParameter)` Creates a new `IModeledToolOutputParameter` instance based on the provided `RToolOutParameter`
    `IPropertyValue` | `createPropertyValue(Property pProp)` Creates a new property value without a context.
    `IPropertyValue` | `createPropertyValue(Property pProperty, java.lang.String pValue)` Creates a new property value without a context.
    `IPropertyValue` | `createPropertyValue(Property pProp, java.lang.String pValue, EPropertyValueType pType, IExecutionContext pContext)` Creates a new property value of a specific type.
    `IPropertyValue` | `createPropertyValue(Property pProp, java.lang.String pText, IExecutionContext pContext)` Creates a new property value.
    `static ElementListStructure` | `createSimpleElementListStructure()` Creates a `ElementListStructure` without any columns and a static ID (`ElementListStructure.GENERATED_ID`).
    `ITableResource` | `createTableResource(FileDescriptor pFileDescr)` Creates a new table resource.
    `ITableResource` | `createTableResource(FileDescriptor pFileDescr, java.util.List<ITableResource> pTabEntryListEntryList)` Creates a new table resource.
    `ActionDescriptor` | `getAction(java.lang.String pActionID)` Gets the action descriptor with the given ID from the currently loaded model.
    `IActiveTaurusApplication` | `getActiveApplication()` Gets the `IActiveTaurusApplication` instance.
    `IElementDirectory` | `getElementDirectory()` Gets the element directory singleton instance.
    `IElementListDirectory` | `getElementListDirectory()` Gets the element list directory singleton instance.
    `ElementListStructure` | `getElementListStructure(java.lang.String pElementListStructureID)` Gets the element list structure with the given ID from the currently loaded model.
    `ElementType` | `getElementType(java.lang.String pElementTypeID)` Return the element type for the given element type id.
    `IErrorFeedbackEntryList` | `getErrorFeedbackEntryList()` Gets the error feedback list singleton instance.
    `IFilterList` | `getFilterList()` Gets the filter list singleton instance.
    `FilterType` | `getFilterType(java.lang.String pFilterTypeID)` Return the filter type for the given filter type id.
    `static TaurusFactory` | `getInstance()` Gets the singleton instance.
    `IJobDirectory` | `getJobDirectory()` Gets the job directory singleton instance.
    `IProcessDirectory` | `getProcessDirectory()` Gets the process directory singleton instance.
    `Property` | `getProperty(java.lang.String pPropertyID)` Gets a property with the given ID from the currently loaded model.
    `IResource` | `getResource(java.lang.String pResourceID)` Gets the `IResource` with the given ID from the currently loaded application.
    `java.lang.String` | `getSpecialAttributeValue(TAURUSConfiguration pTauConf, java.lang.String pAttributeName)` Gets a "Specific Attribute" value (Application Options) from the given AWM model.
    `ITaurusSystemDirectory` | `getSystemDirectory()` Gets the system directory singleton instance.
    `TAURUSConfiguration` | `getTaurusConfig()` Gets the currently loaded model.
    `ITaurusConfigLoader` | `getTaurusConfigLoader()` Gets the singleton instance of the AWM model loader.
    `ToolDescriptor` | `getTool(java.lang.String pToolID)` Gets the tool descriptor with the given ID from the currently loaded model.

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

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

- - ### Method Detail

    - #### getInstance

          public static TaurusFactory getInstance()

      Gets the singleton instance.
      Returns:
        the `TaurusFactory` instance

    - #### getElementDirectory

          public IElementDirectory getElementDirectory()

      Gets the element directory singleton instance.
      Returns:
        the `IElementDirectory` instance

    - #### createElementList

          public IElementList createElementList(ElementListStructure pElementListStructure,
                                                ActionDescriptor pAction)

      Same as calling `createElementList(ElementListStructure, ActionDescriptor, null, null)`.
      Parameters:
        `pElementListStructure` - the element list structure of the element list
        `pAction` - the action which created the element list
      Returns:
        a new `IElementList`

    - #### createElementList

          public IElementList createElementList(ElementListStructure pElementListStructure,
                                                ActionDescriptor pAction,
                                                java.lang.String pElementListID)

      Same as calling `createElementList(ElementListStructure, ActionDescriptor, String, null)`.
      Parameters:
        `pElementListStructure` - the element list structure of the element list
        `pAction` - the action which created the element list
        `pElementListID` - can be `null` (an ID will be generated)
      Returns:
        a new `IElementList`

    - #### createElementList

          public IElementList createElementList(ElementListStructure pElementListStructure,
                                                ActionDescriptor pAction,
                                                java.lang.String pElementListID,
                                                IResource pParent)

      Creates an `IElementList` depending on the given parent `IResource`.
      Parameters:
        `pElementListStructure` - the element list structure of the element list
        `pAction` - the action which created the element list
        `pElementListID` - can be `null` (an ID will be generated)
        `pParent` - can be `null`
      Returns:
        a new `IElementList`

    - #### getElementListDirectory

          public IElementListDirectory getElementListDirectory()

      Gets the element list directory singleton instance.
      Returns:
        the `IElementListDirectory` instance

    - #### getProcessDirectory

          public IProcessDirectory getProcessDirectory()

      Gets the process directory singleton instance.
      Returns:
        the `IProcessDirectory` instance

    - #### createElementListKey

          public IElementListKey createElementListKey(ActionDescriptor pAction,
                                                      IResource pResource)

      Creates an element list key.
      Parameters:
        `pAction` - the action descriptor
        `pResource` - the resource
      Returns:
        a new `IElementListKey`

    - #### getFilterList

          public IFilterList getFilterList()

      Gets the filter list singleton instance.
      Returns:
        the `IFilterList` instance

    - #### createExecutionContext

          public IExecutionContext createExecutionContext(ISystemImage pTaurusSystem)

      Creates a basic execution context.
      Parameters:
        `pTaurusSystem` - the system
      Returns:
        a new `IExecutionContext`

    - #### createExecutionContext

          public IExecutionContext createExecutionContext(ISystemImage pSys,
                                                          ActionDescriptor pActionDescriptor)

      Creates an execution context.
      Parameters:
        `pSys` - the system image
        `pActionDescriptor` - an action descriptor
      Returns:
        a new `IExecutionContext`

    - #### createFilter

          public IFilter createFilter(FilterType pFilterType,
                                      java.lang.String pID)

      Creates a new filter.
      Parameters:
        `pFilterType` - the filter type
        `pID` - the filter ID (can be `null`. An unique ID will be generated.)
      Returns:
        a new `IFilter`

    - #### getSystemDirectory

          public ITaurusSystemDirectory getSystemDirectory()

      Gets the system directory singleton instance.
      Returns:
        the `ITaurusSystemDirectory` instance

    - #### createFileDescriptor

          public FileDescriptor createFileDescriptor()

      Creates a new `FileDescriptor`. All required file descriptor attributes must be set manually.
      Returns:
        a new file descriptor

    - #### getActiveApplication

          public IActiveTaurusApplication getActiveApplication()

      Gets the `IActiveTaurusApplication` instance.
      Returns:
        the active application instance

    - #### getJobDirectory

          public IJobDirectory getJobDirectory()

      Gets the job directory singleton instance.
      Returns:
        the `IJobDirectory` instance

    - #### createFileResource

          public IFileResource createFileResource(FileDescriptor pFD)

      Creates a simple file resource for the given file descriptor.
      Parameters:
        `pFD` - the file descriptor
      Returns:
        a new `IFileResource`

    - #### createJob

          public ITaurusJob createJob(java.lang.String pJobID,
                                      java.lang.String pCacheID)

      Creates a new Taurus job.
      Parameters:
        `pJobID` - the job ID
        `pCacheID` - the cache ID
      Returns:
        a new `ITaurusJob`

    - #### createJob

          public ITaurusJob createJob(java.lang.String pJobID)

      Creates a new Taurus job.
      Parameters:
        `pJobID` - the job ID
      Returns:
        a new `ITaurusJob`

    - #### createElement

          public IElement createElement(java.lang.String pElementId,
                                        ElementType pElementTyp)

      Creates a new element.
      Parameters:
        `pElementId` - the element ID
        `pElementTyp` - the element type
      Returns:
        a new `IElement`

    - #### createElementListEntry

          public IElementListEntry createElementListEntry(IElementList pElementList,
                                                          java.lang.String pElementId,
                                                          ElementType pElementTyp)
                                                   throws TaurusCoreException

      Creates a new element list entry.
      Parameters:
        `pElementList` - the element list
        `pElementId` - the element ID
        `pElementTyp` - the element type
      Returns:
        a new `IElementListEntry`
      Throws:
        `TaurusCoreException` - if the creation of the entry (or the element) fails

    - #### createElementListEntry

          public IElementListEntry createElementListEntry(IElementList pElementList,
                                                          java.lang.String pElementId,
                                                          ElementType pElementTyp,
                                                          int pState)
                                                   throws TaurusCoreException

      Creates a new element list entry.
      Parameters:
        `pElementList` - the element list
        `pElementId` - the element ID
        `pElementTyp` - the element type
        `pState` - the element list entry state flag
      Returns:
        a new `IElementListEntry`
      Throws:
        `TaurusCoreException` - if the creation of the entry (or the element) fails

    - #### createElementListEntry

          public IElementListEntry createElementListEntry(IElementList pElementList,
                                                          java.lang.String pElementListEntryID,
                                                          IElement pElement)

      Creates a new element list entry.
      Parameters:
        `pElementList` - the element list
        `pElementListEntryID` - the cache ID of the entry
        `pElement` - the parent element
      Returns:
        a new `IElementListEntry`

    - #### getTaurusConfigLoader

          public ITaurusConfigLoader getTaurusConfigLoader()

      Gets the singleton instance of the AWM model loader.
      Returns:
        the `ITaurusConfigLoader` instance

    - #### getTaurusConfig

          public TAURUSConfiguration getTaurusConfig()

      Gets the currently loaded model.
      Returns:
        the currently loaded `TAURUSConfiguration`

    - #### createLinkedPropertyValue

          public IPropertyValue createLinkedPropertyValue(LinkedProperty pProp,
                                                          IExecutionContext pContext)

      Creates a property value for linked properties.
      Parameters:
        `pProp` - an `Property`. Must not be `null`.
        `pContext` - execution context
      Returns:
        an `IPropertyValue` with no value.

    - #### createTableResource

          public ITableResource createTableResource(FileDescriptor pFileDescr)

      Creates a new table resource.
      Parameters:
        `pFileDescr` - the structured file descriptor describing the table
      Returns:
        a new `ITableResource`

    - #### createTableResource

          public ITableResource createTableResource(FileDescriptor pFileDescr,
                                                    java.util.List<ITableResource> pTabEntryListEntryList)

      Creates a new table resource.
      Parameters:
        `pFileDescr` - the structured file descriptor describing the table
        `pTabEntryListEntryList` - the list of `ITableResource` where the new `ITableResource` will be created.
      Returns:
        a new `ITableResource`

    - #### createErrorFeedbackEntry

          public IErrorFeedbackEntry createErrorFeedbackEntry(java.lang.String pFileName,
                                                              java.lang.String pMsgText,
                                                              java.lang.String pMsgNUMBER,
                                                              java.lang.String pMsgLine,
                                                              IElement pResource,
                                                              java.util.Map<java.lang.String,java.lang.String> pCustomFileAttributes,
                                                              java.util.Map<java.lang.String,java.lang.String> pCustomMessageAttributes)

      Creates an error feedback entry.
      Parameters:
        `pFileName` - the source file name
        `pMsgText` - the message text
        `pMsgNUMBER` - the message number
        `pMsgLine` - the line in which the error occurred
        `pResource` - the source element
        `pCustomFileAttributes` - the custom attributes which are defined on file level
        `pCustomMessageAttributes` - the custom attributes which are defined on message level
      Returns:
        a new `IErrorFeedbackEntry`

    - #### createErrorFeedbackEntry

          public IErrorFeedbackEntry createErrorFeedbackEntry(java.lang.String pFileName,
                                                              java.lang.String pMsgText,
                                                              java.lang.String pMsgNUMBER,
                                                              java.lang.String pMsgLine,
                                                              IElement pResource)

      Creates an error feedback entry.
      Parameters:
        `pFileName` - the source file name
        `pMsgText` - the message text
        `pMsgNUMBER` - the message number
        `pMsgLine` - the line in which the error occurred
        `pResource` - the source element
      Returns:
        a new `IErrorFeedbackEntry`

    - #### createErrorFeedbackEntry

          public IErrorFeedbackEntry createErrorFeedbackEntry()

      Creates a new empty error feedback entry.
      Returns:
        a new `IErrorFeedbackEntry`
      See Also:
        `createErrorFeedbackEntry(String, String, String, String, IElement)`

    - #### getErrorFeedbackEntryList

          public IErrorFeedbackEntryList getErrorFeedbackEntryList()

      Gets the error feedback list singleton instance.
      Returns:
        the `IErrorFeedbackEntryList` instance

    - #### getSpecialAttributeValue

          public java.lang.String getSpecialAttributeValue(TAURUSConfiguration pTauConf,
                                                           java.lang.String pAttributeName)

      Gets a "Specific Attribute" value (Application Options) from the given AWM model.
      Parameters:
        `pTauConf` - the AWM model
        `pAttributeName` - the attribute name
      Returns:
        the attribute value or `null` if no attribute with the given name exists or no value has been set

    - #### getProperty

          public Property getProperty(java.lang.String pPropertyID)

      Gets a property with the given ID from the currently loaded model.
      Parameters:
        `pPropertyID` - the desired property ID
      Returns:
        the property or `null` if no property with the given ID exists in the currently loaded model

    - #### getElementType

          public ElementType getElementType(java.lang.String pElementTypeID)

      Return the element type for the given element type id.
      Parameters:
        `pElementTypeID` - id of the element type
      Returns:
        the element type for the given element type id

    - #### getFilterType

          public FilterType getFilterType(java.lang.String pFilterTypeID)

      Return the filter type for the given filter type id.
      Parameters:
        `pFilterTypeID` - id of the filter type
      Returns:
        the filter type for the given filter type id

    - #### getAction

          public ActionDescriptor getAction(java.lang.String pActionID)

      Gets the action descriptor with the given ID from the currently loaded model.
      Parameters:
        `pActionID` - the desired action descriptor ID
      Returns:
        the `ActionDescriptor` with the given ID or `null` if no action descriptor with the ID exists

    - #### getTool

          public ToolDescriptor getTool(java.lang.String pToolID)

      Gets the tool descriptor with the given ID from the currently loaded model.
      Parameters:
        `pToolID` - the desired tool descriptor ID
      Returns:
        the `ToolDescriptor` with the given ID or `null` if no tool descriptor with the ID exists

    - #### createSimpleElementListStructure

          public static ElementListStructure createSimpleElementListStructure()

      Creates a `ElementListStructure` without any columns and a static ID (`ElementListStructure.GENERATED_ID`).
      Returns:
        a new element list structure

    - #### getElementListStructure

          public ElementListStructure getElementListStructure(java.lang.String pElementListStructureID)

      Gets the element list structure with the given ID from the currently loaded model.
      Parameters:
        `pElementListStructureID` - the desired element list structure ID
      Returns:
        the `ElementListStructure` with the given ID or `null` if no element list structure with the ID exists

    - #### getResource

          public IResource getResource(java.lang.String pResourceID)

      Gets the `IResource` with the given ID from the currently loaded application.

      Note: Will display an error message if no resource with the given ID was not found.

      Parameters:
        `pResourceID` - ID of the resource
      Returns:
        the resource with the given ID or `null` if the resource was not found.

    - #### clearMaps

          public void clearMaps()

      Clears internal cache maps.

      Should not be called by clients.

    - #### createPropertyValue

          public IPropertyValue createPropertyValue(Property pProp,
                                                    java.lang.String pText,
                                                    IExecutionContext pContext)

      Creates a new property value.
      Parameters:
        `pProp` - the property
        `pText` - the value (can be `null`)
        `pContext` - execution context (can be `null` but required for resolving linked properties with resource identifier)
      Returns:
        a new `IPropertyValue`

    - #### createPropertyValue

          public IPropertyValue createPropertyValue(Property pProp,
                                                    java.lang.String pValue,
                                                    EPropertyValueType pType,
                                                    IExecutionContext pContext)

      Creates a new property value of a specific type.
      Parameters:
        `pProp` - the property
        `pValue` - the value (can be `null`)
        `pType` - the property value type (can be `null`)
        `pContext` - execution context (can be `null` but required for resolving linked properties with resource identifier)
      Returns:
        a new `IPropertyValue`

    - #### createAttributeContext

          public static IExecutionContext createAttributeContext(DynamicObject pDynObj)

      Create a context with dynamic attributes of the tool descriptor.
      Parameters:
        `pDynObj` - the dynamic object
      Returns:
        an execution context which can be used to check enabled conditions

    - #### createPropertyValue

          public IPropertyValue createPropertyValue(Property pProperty,
                                                    java.lang.String pValue)

      Creates a new property value without a context.

      Note: A context is required for resolving linked properties.

      Parameters:
        `pProperty` - the property
        `pValue` - the property value (can be `null`)
      Returns:
        a new `IPropertyValue`

    - #### createPropertyValue

          public IPropertyValue createPropertyValue(Property pProp)

      Creates a new property value without a context.

      Note: A context is required for resolving linked properties.

      Parameters:
        `pProp` - the property
      Returns:
        a new `IPropertyValue`
      See Also:
        `createPropertyValue(Property, String, IExecutionContext)`

    - #### createIntegratedToolExecutor

          @Deprecated
          public IToolExecutor createIntegratedToolExecutor()

      Deprecated. the `IntegratedToolExecuter` is based on the legacy tool interface `IToolExecutor` which should no longer be used. Use the `IToolExecutor2` interface instead.
      Creates an instance of a `IntegratedToolExecuter`
      Returns:
        an instance of `IntegratedToolExecuter`

    - #### createInputParameter

          public static IToolInputParameter createInputParameter(RToolInParameter pRToolInParameter,
                                                                 IToolContext pToolContext)
                                                          throws TaurusToolException

      Creates a new `IToolInputParameter` instance based on the provided `RToolInParameter` and `IToolContext`.
      Parameters:
        `pRToolInParameter` - the given `RToolInParameter` which is used to create the `IToolInputParameter`
        `pToolContext` - the `IToolContext` which is used to determine the values for the `IToolInputParameter`.
      Returns:
        a new instance of `IToolInputParameter`
      Throws:
        `TaurusToolException` - if the `EParameterTypes` of the `RToolInParameter` is not supported (e.g. deprecated parameter type)

    - #### createOutputParameter

          public static IModeledToolOutputParameter createOutputParameter(RToolOutParameter pRToolOutParameter)

      Creates a new `IModeledToolOutputParameter` instance based on the provided `RToolOutParameter`
      Parameters:
        `pRToolOutParameter` - the given `RToolInParameter` which is used to create the `IModeledToolOutputParameter`
      Returns:
        the `IModeledToolOutputParameter` instance or `null` if the parameter type is deprecated.

    - #### createFunctionPackage

          public static IFunctionPackage createFunctionPackage(FunctionPackage pFunctionPackage)

      Creates a new `IFunctionPackage` to wrap the `FunctionPackage` model object.
      Parameters:
        `pFunctionPackage` - the `FunctionPackage` implementation which should be wrapped.
      Returns:
        a new `IFunctionPackage` which wraps the provided `FunctionPackage`.

Copyright © 2015 Micro Focus GmbH. All rights reserved.