com.microfocus.awm.control.toolexecution.internal

## Class AbstractToolContext

- java.lang.Object
- - com.microfocus.awm.control.toolexecution.internal.AbstractToolContext

- All Implemented Interfaces:
    IDynamicObject, IToolContext
  Direct Known Subclasses:
    MassProcessingSubContext, SingleProcessingToolContext

      public abstract class AbstractToolContext
      extends java.lang.Object
      implements IToolContext

  Abstract base implementation of `IToolContext`. Handles `IToolParameter`s to be created and added to the context depending of `isPartOfContext(RToolParameter)`.
  Author:
    Micro Focus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractToolContext(ToolDescriptor pToolDescriptor, IExecutionContext pContext)` Creates a tool context.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IExecutionContext` | `getExecutionContext()` Gets the `IExecutionContext` of the currently executed action.
    `IFunctionPackage` | `getFunctionPackage()` Gets the function package instance which defines the `ToolDescriptor` type.
    `java.util.List<IToolInputParameter>` | `getInputParameters()` Gets all input parameters of the tool context.
    `java.util.Collection<IToolInputParameter>` | `getInputParameters(java.lang.String pName)` Gets all input parameters of the tool context with the specified name.
    `ToolDescriptor` | `getModelObject()` Gets the model object.
    `java.util.List<IModeledToolOutputParameter>` | `getOutputParameters()` Gets all output parameters of the tool context.
    `java.util.Collection<IModeledToolOutputParameter>` | `getOutputParameters(java.lang.String pName)` Gets all output parameters of the tool context with the specified name.

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

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

    - ### Methods inherited from interface com.microfocus.awm.model.toolexecution.IDynamicObject

      `getAttributes, getAttributeValue, getComplexAttributes`

- - ### Constructor Detail

    - #### AbstractToolContext

          public AbstractToolContext(ToolDescriptor pToolDescriptor,
                                     IExecutionContext pContext)

      Creates a tool context.

      Note: `createParameters(ToolDescriptor, IExecutionContext)` must be called manually after initializing the abstract tool context.

      Parameters:
        `pToolDescriptor` - the tool descriptor
        `pContext` - execution context

  - ### Method Detail

    - #### getFunctionPackage

          public IFunctionPackage getFunctionPackage()

      Description copied from interface: `IToolContext`
      Gets the function package instance which defines the `ToolDescriptor` type.
      Specified by:
        `getFunctionPackage` in interface `IToolContext`
      Returns:
        the function package instance or `null` if it doesn't exist in the model

    - #### getModelObject

          public ToolDescriptor getModelObject()

      Description copied from interface: `IDynamicObject`
      Gets the model object.
      Specified by:
        `getModelObject` in interface `IDynamicObject`
      Specified by:
        `getModelObject` in interface `IToolContext`
      Returns:
        the model object

    - #### getExecutionContext

          public IExecutionContext getExecutionContext()

      Description copied from interface: `IToolContext`
      Gets the `IExecutionContext` of the currently executed action.
      Specified by:
        `getExecutionContext` in interface `IToolContext`
      Returns:
        the execution context

    - #### getInputParameters

          public java.util.Collection<IToolInputParameter> getInputParameters(java.lang.String pName)

      Description copied from interface: `IToolContext`
      Gets all input parameters of the tool context with the specified name.

      The name can either be the parameter's `id` attribute of the `toolType` extension or the fully qualified `id`, starting with the function package ID and ending with the parameter `id`.

      See `ToolUtility` for more methods to obtain specific input parameters.

      Specified by:
        `getInputParameters` in interface `IToolContext`
      Parameters:
        `pName` - name of the desired parameter(s)
      Returns:
        a collection of all parameters with the given name

    - #### getInputParameters

          public java.util.List<IToolInputParameter> getInputParameters()

      Description copied from interface: `IToolContext`
      Gets all input parameters of the tool context.

      See `ToolUtility` for more methods to obtain specific input parameters.

      Specified by:
        `getInputParameters` in interface `IToolContext`
      Returns:
        all modeled input parameters
      See Also:
        `IToolInputParameter`

    - #### getOutputParameters

          public java.util.List<IModeledToolOutputParameter> getOutputParameters()

      Description copied from interface: `IToolContext`
      Gets all output parameters of the tool context.

      See `ToolUtility` for more methods to obtain specific output parameters.

      Specified by:
        `getOutputParameters` in interface `IToolContext`
      Returns:
        all modeled output parameters
      See Also:
        `IModeledToolOutputParameter`

    - #### getOutputParameters

          public java.util.Collection<IModeledToolOutputParameter> getOutputParameters(java.lang.String pName)

      Description copied from interface: `IToolContext`
      Gets all output parameters of the tool context with the specified name.

      The name can either be the parameter's `id` attribute of the `toolType` extension or the fully qualified `id`, starting with the function package ID and ending with the parameter `id`.

      See `ToolUtility` for more methods to obtain specific output parameters.

      Specified by:
        `getOutputParameters` in interface `IToolContext`
      Parameters:
        `pName` - name of the desired parameter(s)
      Returns:
        a collection of all parameters with the given name

Copyright © 2015 Micro Focus GmbH. All rights reserved.