public class DefaultModelProblem extends Object implements ModelProblem
ModelProblem.Severity, ModelProblem.Version
Constructor and Description |
---|
DefaultModelProblem(String message,
ModelProblem.Severity severity,
ModelProblem.Version version,
Model source,
int lineNumber,
int columnNumber,
Exception exception)
Creates a new problem with the specified message and exception.
|
DefaultModelProblem(String message,
ModelProblem.Severity severity,
ModelProblem.Version version,
String source,
int lineNumber,
int columnNumber,
String modelId,
Exception exception)
Creates a new problem with the specified message and exception.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
Gets the one-based index of the column containing the problem.
|
Exception |
getException()
Gets the exception that caused this problem (if any).
|
int |
getLineNumber()
Gets the one-based index of the line containing the problem.
|
String |
getMessage()
Gets the message that describes this problem.
|
String |
getModelId()
Gets the identifier of the model from which the problem originated.
|
ModelProblem.Severity |
getSeverity()
Gets the severity level of this problem.
|
String |
getSource()
Gets the hint about the source of the problem.
|
ModelProblem.Version |
getVersion()
Gets the applicable maven version/validation level of this problem
|
String |
toString() |
public DefaultModelProblem(String message, ModelProblem.Severity severity, ModelProblem.Version version, Model source, int lineNumber, int columnNumber, Exception exception)
message
- The message describing the problem, may be null
.severity
- The severity level of the problem, may be null
to default to
ModelProblem.Severity.ERROR
.source
- The source of the problem, may be null
.lineNumber
- The one-based index of the line containing the error or -1
if unknown.columnNumber
- The one-based index of the column containing the error or -1
if unknown.exception
- The exception that caused this problem, may be null
.public DefaultModelProblem(String message, ModelProblem.Severity severity, ModelProblem.Version version, String source, int lineNumber, int columnNumber, String modelId, Exception exception)
message
- The message describing the problem, may be null
.severity
- The severity level of the problem, may be null
to default to
ModelProblem.Severity.ERROR
.version
- The version since the problem is relevantsource
- A hint about the source of the problem like a file path, may be null
.lineNumber
- The one-based index of the line containing the problem or -1
if unknown.columnNumber
- The one-based index of the column containing the problem or -1
if unknown.modelId
- The identifier of the model that exhibits the problem, may be null
.exception
- The exception that caused this problem, may be null
.public String getSource()
ModelProblem
getSource
in interface ModelProblem
null
.public int getLineNumber()
ModelProblem
ModelProblem.getSource()
.getLineNumber
in interface ModelProblem
public int getColumnNumber()
ModelProblem
ModelProblem.getSource()
.getColumnNumber
in interface ModelProblem
public String getModelId()
ModelProblem
groupId:artifactId:version
the returned identifier need not be complete. The identifier is derived
from the information that is available at the point the problem occurs and as such merely serves as a best effort
to provide information to the user to track the problem back to its origin.getModelId
in interface ModelProblem
null
.public Exception getException()
ModelProblem
getException
in interface ModelProblem
null
if not applicable.public String getMessage()
ModelProblem
getMessage
in interface ModelProblem
null
.public ModelProblem.Severity getSeverity()
ModelProblem
getSeverity
in interface ModelProblem
null
.public ModelProblem.Version getVersion()
ModelProblem
getVersion
in interface ModelProblem
null
.Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.