Package: org.gradle.plugins.ide.api

## [Java] Class GeneratorTask<T>

- org.gradle.plugins.ide.api.GeneratorTask

- A `GeneratorTask` generates a configuration file based on a domain object of type T. When executed the task:

  - loads the object from the input file, if it exists.
  - Calls the beforeConfigured actions, passing the object to each action.
  - Configures the object in some task-specific way.
  - Calls the afterConfigured actions, passing the object to each action.
  - writes the object to the output file.
  Parameters:
    `` - The domain object for the configuration file.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected ActionBroadcast<T>` | `afterConfigured` |
    `protected ActionBroadcast<T>` | `beforeConfigured` |
    `protected T` | `domainObject` |
    `protected Generator<T>` | `generator` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GeneratorTask ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `File` | `getInputFile()` The input file to load the initial configuration from.
    `protected Instantiator` | `getInstantiator()`
    `File` | `getOutputFile()` The output file to write the final configuration to.
    `void` | `setInputFile(File inputFile)` Sets the input file to load the initial configuration from.
    `void` | `setOutputFile(File outputFile)` Sets the output file to write the final configuration to.

- - ### Field Detail

    - #### protected final ActionBroadcast<T> afterConfigured

    - #### protected final ActionBroadcast<T> beforeConfigured

    - #### protected T domainObject

    - #### protected Generator<T> generator

  - ### Constructor Detail

    - #### public GeneratorTask()

  - ### Method Detail

    - #### public File getInputFile()

      The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.

      Returns:
        The input file.

    - #### @Inject protected Instantiator getInstantiator()

    - #### @OutputFile public File getOutputFile()

      The output file to write the final configuration to.

      Returns:
        The output file.

    - #### public void setInputFile(File inputFile)

      Sets the input file to load the initial configuration from.

      Parameters:
        `inputFile` - The input file. Use null to use the output file.

    - #### public void setOutputFile(File outputFile)

      Sets the output file to write the final configuration to.

      Parameters:
        `outputFile` - The output file.