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 ProblemSpeccontextualLabel(java.lang.String contextualLabel)Declares a short, but context-dependent message for this problem.ProblemSpecdetails(java.lang.String details)The long description of this problem.ProblemSpecdocumentedAt(java.lang.String url)Declares where this problem is documented.ProblemSpecfileLocation(java.lang.String path)Declares that this problem is in a file.ProblemSpecid(java.lang.String name, java.lang.String displayName)Defines simple identification for this problem.ProblemSpecid(java.lang.String name, java.lang.String displayName, ProblemGroup parent)Defines simple identification for this problem.ProblemSpeclineInFileLocation(java.lang.String path, int line)Declares that this problem is in a file on a line.ProblemSpeclineInFileLocation(java.lang.String path, int line, int column)Declares that this problem is in a file with on a line at a certain position.ProblemSpeclineInFileLocation(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.ProblemSpecoffsetInFileLocation(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.ProblemSpecpluginLocation(java.lang.String pluginId)Declares that this problem is emitted while applying a plugin.ProblemSpecseverity(Severity severity)Declares the severity of the problem.ProblemSpecsolution(java.lang.String solution)A description of how to solve this problem.ProblemSpecstackLocation()Declares that this problem should automatically collect the location information based on the current stack trace.ProblemSpecwithException(java.lang.RuntimeException e)The exception causing this problem.
-
-
-
Method Detail
-
id
ProblemSpec id(java.lang.String name, java.lang.String displayName)
Defines simple identification for this problem.It is a mandatory property to configure when emitting a problem with
ProblemReporter..Calling this method will set the reported problem group to
SharedProblemGroup.generic()- Parameters:
name- the name of the problem. As a convention kebab-case-formatting should be used.displayName- a human-readable representation of the problem, free of any contextual information.- Returns:
- this
- Since:
- 8.8
-
id
ProblemSpec id(java.lang.String name, java.lang.String displayName, ProblemGroup parent)
Defines simple identification for this problem.It is a mandatory property to configure when emitting a problem with
ProblemReporter.- Parameters:
name- the name of the problem. As a convention kebab-case-formatting should be used.displayName- a human-readable representation of the problem, free of any contextual information.parent- the container problem group.- Returns:
- this
- Since:
- 8.8
-
contextualLabel
ProblemSpec contextualLabel(java.lang.String contextualLabel)
Declares a short, but context-dependent message for this problem.- Parameters:
contextualLabel- the short message- Returns:
- this
- Since:
- 8.8
-
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 locationline- 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 locationline- the one-indexed line numbercolumn- 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 locationline- the one-indexed line numbercolumn- the one-indexed columnlength- 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 locationoffset- the zero-indexed global offset from the beginning of the filelength- 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
-
-