com.microfocus.awm.internal.functionpackage.awm.tools

## Class MergeStructuredFiles2

- java.lang.Object
- - com.microfocus.awm.internal.functionpackage.awm.tools.MergeStructuredFiles2

- All Implemented Interfaces:
    IToolExecutor2

      public class MergeStructuredFiles2
      extends java.lang.Object
      implements IToolExecutor2

  AWM tool which is capable to selectively merge file contents of two or more structured file descriptors into one. It parses all property values from modeled file input parameters and writes them into a single result file.
  Author:
    RalfP

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MergeStructuredFiles2()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IToolResult` | `executeMassProcessing(IMassProcessingToolContext pMassProcessingContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Executes the tool for multiple resource.
    `IToolResult` | `executeSingleProcessing(IToolContext pToolContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Executes the tool for a single resource.
    `void` | `init(IToolContext pToolContext)` Initializes the tool executor before it is being executed.
    `boolean` | `supportsMassProcessing()` Whether the tool executor supports mass processing execution.

    - ### 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.IToolExecutor2

      `createToolContext`

- - ### Constructor Detail

    - #### MergeStructuredFiles2

          public MergeStructuredFiles2()

  - ### Method Detail

    - #### init

          public void init(IToolContext pToolContext)
                    throws TaurusToolException

      Description copied from interface: `IToolExecutor2`
      Initializes the tool executor before it is being executed. This can be used process or validate tool descriptor attributes and parameters.
      Specified by:
        `init` in interface `IToolExecutor2`
      Parameters:
        `pToolContext` - the tool context
      Throws:
        `TaurusToolException` - if the tool executor cannot be initialized for any reason

    - #### executeSingleProcessing

          public IToolResult executeSingleProcessing(IToolContext pToolContext,
                                                     org.eclipse.core.runtime.IProgressMonitor pMon)
                                              throws TaurusToolException

      Description copied from interface: `IToolExecutor2`
      Executes the tool for a single resource.

      A tool typically obtains values of modeled attributes and input parameters through the `IToolContext` (or `ToolUtility` helper methods), runs its specific function and returns all results (including possible output parameters) in the `IToolResult`.

      This method gets called if the tool is being executed from an `ActionDescriptor` with the `Mass Processing` attribute set to `false` or if `IToolExecutor2.supportsMassProcessing()` returned `false`.

      The tool context contains all parameters, since their `Mass Processing` flags are ignored during single processing execution.

      Specified by:
        `executeSingleProcessing` in interface `IToolExecutor2`
      Parameters:
        `pToolContext` - the tool context
        `pMon` - a progress monitor. Setting the monitor to `canceled` will cancel the action after the tool has been executed
      Returns:
        an `IToolResult`
      Throws:
        `TaurusToolException` - if the tool cannot be executed for any reason
      See Also:
        `ToolUtility`

    - #### executeMassProcessing

          public IToolResult executeMassProcessing(IMassProcessingToolContext pMassProcessingContext,
                                                   org.eclipse.core.runtime.IProgressMonitor pMon)
                                            throws TaurusToolException

      Description copied from interface: `IToolExecutor2`
      Executes the tool for multiple resource. In contrast to `IToolExecutor2.executeSingleProcessing(IToolContext, IProgressMonitor)` the tool executor can process multiple resources with a single call.

      If the tool executor does not support mass processing execution (by returning `false` with `IToolExecutor2.supportsMassProcessing()`), this method will never by called by AWM and can simply return `null`.

      The list of resources to be processed by the mass processing action can be obtained from the mass processing tool context via `IMassProcessingToolContext.getSubContexts()`.

      The `IMassProcessingToolContext` only contains parameters with the `Mass Processing` flag set to `false`. Mass processing parameters are contained by its sub-contexts.

      Specified by:
        `executeMassProcessing` in interface `IToolExecutor2`
      Parameters:
        `pMassProcessingContext` - the mass processing context
        `pMon` - a progress monitor. Setting the monitor to `canceled` will cancel the action after the tool has been executed
      Returns:
        an `IToolResult`. Can be `null` if `IToolExecutor2.supportsMassProcessing()` returned `false`
      Throws:
        `TaurusToolException` - if the tool cannot be executed for any reason
      See Also:
        `ToolUtility`

    - #### supportsMassProcessing

          public boolean supportsMassProcessing()

      Description copied from interface: `IToolExecutor2`
      Whether the tool executor supports mass processing execution. Returns `true` by default.

      If `false` is returned, the tool executor cannot effectively process multiple resources (e.g. selected elements). This can be intended for tools not directly processing selected elements. In this case AWM will always call `IToolExecutor2.executeSingleProcessing(IToolContext, IProgressMonitor)` and never `IToolExecutor2.executeMassProcessing(IMassProcessingToolContext, IProgressMonitor)`.

      If applicable, tool executors should always aim for implementing mass processing support, since it can increase their usability in AWM models.

      Specified by:
        `supportsMassProcessing` in interface `IToolExecutor2`
      Returns:
        `true` if the tool supports mass processing, otherwise `false`

Copyright © 2015 Micro Focus GmbH. All rights reserved.