Package org.gradle.api.problems

## Interface ProblemSpec

-     @Incubating
      public interface ProblemSpec

  Provides options to configure problems.

  Since:
    8.6
  See Also:
    `ProblemReporter`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ProblemSpec` | `category​(java.lang.String category, java.lang.String... subcategories)` | A category groups related problems together.
    `ProblemSpec` | `details​(java.lang.String details)` | The long description of this problem.
    `ProblemSpec` | `documentedAt​(java.lang.String url)` | Declares where this problem is documented.
    `ProblemSpec` | `fileLocation​(java.lang.String path)` | Declares that this problem is in a file.
    `ProblemSpec` | `label​(java.lang.String label)` | Declares a short message for this problem.
    `ProblemSpec` | `lineInFileLocation​(java.lang.String path, int line)` | Declares that this problem is in a file on a line.
    `ProblemSpec` | `lineInFileLocation​(java.lang.String path, int line, int column)` | Declares that this problem is in a file with on a line at a certain position.
    `ProblemSpec` | `lineInFileLocation​(java.lang.String path, int line, int column, int length)` | Declares that this problem is in a file with on a line at a certain position.
    `ProblemSpec` | `offsetInFileLocation​(java.lang.String path, int offset, int length)` | Declares that this problem is in a file at a certain global position with a given length.
    `ProblemSpec` | `pluginLocation​(java.lang.String pluginId)` | Declares that this problem is emitted while applying a plugin.
    `ProblemSpec` | `severity​(Severity severity)` | Declares the severity of the problem.
    `ProblemSpec` | `solution​(java.lang.String solution)` | A description of how to solve this problem.
    `ProblemSpec` | `stackLocation()` | Declares that this problem should automatically collect the location information based on the current stack trace.
    `ProblemSpec` | `withException​(java.lang.RuntimeException e)` | The exception causing this problem.

- - ### Method Detail

    - #### label

          ProblemSpec label​(java.lang.String label)

      Declares a short message for this problem.

      The label is the main, human-readable representation of the problem. It is a mandatory property to configure when emitting a problem with `ProblemReporter`.

      Parameters:
        `label` - the short message
      Returns:
        this
      Since:
        8.6

    - #### category

          ProblemSpec category​(java.lang.String category,
                               java.lang.String... subcategories)

      A category groups related problems together.

      Category is a mandatory property to configure when emitting a problem with `ProblemReporter`.

      A category defines the following hierarchical elements to distinguish instances:

      - namespace
      - category
      - subcategories

      The namespace provides separation for identical problems emitted from different components. Problems emitted from Gradle core will use the `org.gradle` namespace. Third party plugins are expected to use their plugin id for namespace. Problems emitted from build scripts should use the `buildscript` namespace. The namespace is bound to `ProblemReporter`, hence it is absent from the argument list.

      A category should contain the most broad term describing the problem. A few examples are: `compilation`, `deprecation`, `task-validation`.

      The problem category can be refined with an optional hierarchy of subcategories. For example, a problem covering a java compilation warning can be denoted with the following subcategories: `[java, unused-variable]`.

      The categorization depends on the domain and don't have any constraints. Clients (i.e. IDEs) receiving problems should use the category information for properly group and sort the received instances. However, we recommend to use the same conventions as the problems emitted from Gradle core use.

      - Entries should be all-lowercase using a dash for separator (i.e. kebab-case)
      - Should be strictly hierarchical: the category declares the domain and subcategories provide further refinement
      A few examples with a path-like notation (i.e. `category:subcategory1:subcategory2`).
      - compilation:groovy-dsl
      - compilation:java:unused-import
      - deprecation:user-code-direct
      - task-selection:no-matches
      Parameters:
        `category` - the type name
        `subcategories` - the type subcategories
      Returns:
        this
      Since:
        8.6

    - #### documentedAt

          ProblemSpec documentedAt​(java.lang.String url)

      Declares where this problem is documented.
      Returns:
        this
      Since:
        8.6

    - #### fileLocation

          ProblemSpec fileLocation​(java.lang.String path)

      Declares that this problem is in a file.
      Parameters:
        `path` - the file location
      Returns:
        this
      Since:
        8.6

    - #### lineInFileLocation

          ProblemSpec lineInFileLocation​(java.lang.String path,
                                         int line)

      Declares that this problem is in a file on a line.
      Parameters:
        `path` - the file location
        `line` - the one-indexed line number
      Returns:
        this
      Since:
        8.6

    - #### lineInFileLocation

          ProblemSpec lineInFileLocation​(java.lang.String path,
                                         int line,
                                         int column)

      Declares that this problem is in a file with on a line at a certain position.

      Parameters:
        `path` - the file location
        `line` - the one-indexed line number
        `column` - the one-indexed column
      Returns:
        this
      Since:
        8.6

    - #### lineInFileLocation

          ProblemSpec lineInFileLocation​(java.lang.String path,
                                         int line,
                                         int column,
                                         int length)

      Declares that this problem is in a file with on a line at a certain position.
      Parameters:
        `path` - the file location
        `line` - the one-indexed line number
        `column` - the one-indexed column
        `length` - the length of the text
      Returns:
        this
      Since:
        8.6

    - #### offsetInFileLocation

          ProblemSpec offsetInFileLocation​(java.lang.String path,
                                           int offset,
                                           int length)

      Declares that this problem is in a file at a certain global position with a given length.
      Parameters:
        `path` - the file location
        `offset` - the zero-indexed global offset from the beginning of the file
        `length` - the length of the text
      Returns:
        this
      Since:
        8.6

    - #### pluginLocation

          ProblemSpec pluginLocation​(java.lang.String pluginId)

      Declares that this problem is emitted while applying a plugin.
      Parameters:
        `pluginId` - the ID of the applied plugin
      Returns:
        this
      Since:
        8.6

    - #### stackLocation

          ProblemSpec stackLocation()

      Declares that this problem should automatically collect the location information based on the current stack trace.
      Returns:
        this
      Since:
        8.6

    - #### details

          ProblemSpec details​(java.lang.String details)

      The long description of this problem.
      Parameters:
        `details` - the details
      Returns:
        this
      Since:
        8.6

    - #### solution

          ProblemSpec solution​(java.lang.String solution)

      A description of how to solve this problem.
      Parameters:
        `solution` - the solution.
      Returns:
        this
      Since:
        8.6

    - #### withException

          ProblemSpec withException​(java.lang.RuntimeException e)

      The exception causing this problem.
      Parameters:
        `e` - the exception.
      Returns:
        this
      Since:
        8.6

    - #### severity

          ProblemSpec severity​(Severity severity)

      Declares the severity of the problem.
      Parameters:
        `severity` - the severity
      Returns:
        this
      Since:
        8.6