Package org.apache.maven.model.building
Class DefaultModelProblemCollector
java.lang.Object
org.apache.maven.model.building.DefaultModelProblemCollector
- All Implemented Interfaces:
ModelProblemCollector,ModelProblemCollectorExt
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<ModelProblem> private final ModelBuildingResultprivate Modelprivate Set<ModelProblem.Severity> private Stringprivate Model -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ModelProblem problem) voidAdds the specified problem.voidaddAll(List<ModelProblem> problems) private StringThe collected problems.private StringbooleanbooleanvoidsetRootModel(Model rootModel) voidvoid
-
Field Details
-
result
-
problems
-
source
-
sourceModel
-
rootModel
-
severities
-
-
Constructor Details
-
DefaultModelProblemCollector
DefaultModelProblemCollector(ModelBuildingResult result)
-
-
Method Details
-
hasFatalErrors
public boolean hasFatalErrors() -
hasErrors
public boolean hasErrors() -
getProblems
Description copied from interface:ModelProblemCollectorExtThe collected problems.- Specified by:
getProblemsin interfaceModelProblemCollectorExt- Returns:
- a list of model problems encountered, never
null
-
setSource
-
setSource
-
getSource
-
getModelId
-
setRootModel
-
getRootModel
-
getRootModelId
-
add
-
addAll
-
add
Description copied from interface:ModelProblemCollectorAdds the specified problem.- Specified by:
addin interfaceModelProblemCollector- Parameters:
req- must not be null
-
newModelBuildingException
-