Package org.apache.maven.api.services
Interface ModelProblemCollector
public interface ModelProblemCollector
Collects problems that are encountered during model building. The primary purpose of this component is to account for
the fact that the problem reporter has/should not have information about the calling context and hence cannot provide
an expressive source hint for the model problem. Instead, the source hint is configured by the model builder before
it delegates to other components that potentially encounter problems. Then, the problem reporter can focus on
providing a simple error message, leaving the donkey work of creating a nice model problem to this component.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
add
(BuilderProblem.Severity severity, ModelProblem.Version version, String message) default void
add
(BuilderProblem.Severity severity, ModelProblem.Version version, String message, Exception exception) default void
add
(BuilderProblem.Severity severity, ModelProblem.Version version, String message, InputLocation location) void
add
(BuilderProblem.Severity severity, ModelProblem.Version version, String message, InputLocation location, Exception exception) void
add
(ModelProblem problem) The collected problems.boolean
boolean
void
setRootModel
(Model model) void
void
-
Method Details
-
getProblems
List<ModelProblem> getProblems()The collected problems.- Returns:
- a list of model problems encountered, never
null
-
hasErrors
boolean hasErrors() -
hasFatalErrors
boolean hasFatalErrors() -
add
-
add
default void add(BuilderProblem.Severity severity, ModelProblem.Version version, String message, InputLocation location) -
add
default void add(BuilderProblem.Severity severity, ModelProblem.Version version, String message, Exception exception) -
add
void add(BuilderProblem.Severity severity, ModelProblem.Version version, String message, InputLocation location, Exception exception) -
add
-
newModelBuilderException
ModelBuilderException newModelBuilderException() -
setSource
-
setSource
-
getSource
String getSource() -
setRootModel
-
getRootModel
Model getRootModel()
-