Package org.apache.maven.model.building
Class DefaultModelBuildingResult
- java.lang.Object
-
- org.apache.maven.model.building.DefaultModelBuildingResult
-
- All Implemented Interfaces:
ModelBuildingResult
class DefaultModelBuildingResult extends java.lang.Object implements ModelBuildingResult
Collects the output of the model builder.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Profile>
activeExternalProfiles
private java.util.Map<java.lang.String,java.util.List<Profile>>
activePomProfiles
private Model
effectiveModel
private java.util.List<java.lang.String>
modelIds
private java.util.List<ModelProblem>
problems
private java.util.Map<java.lang.String,Model>
rawModels
-
Constructor Summary
Constructors Constructor Description DefaultModelBuildingResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultModelBuildingResult
addModelId(java.lang.String modelId)
java.util.List<Profile>
getActiveExternalProfiles()
Gets the external profiles that were active during model building.java.util.List<Profile>
getActivePomProfiles(java.lang.String modelId)
Gets the profiles from the specified model that were active during model building.Model
getEffectiveModel()
Gets the assembled model.java.util.List<java.lang.String>
getModelIds()
Gets the sequence of model identifiers that denote the lineage of models from which the effective model was constructed.java.util.List<ModelProblem>
getProblems()
Gets the problems that were encountered during the model building.Model
getRawModel()
Gets the raw model as it was read from the input model source.Model
getRawModel(java.lang.String modelId)
Gets the specified raw model as it was read from a model source.DefaultModelBuildingResult
setActiveExternalProfiles(java.util.List<Profile> activeProfiles)
DefaultModelBuildingResult
setActivePomProfiles(java.lang.String modelId, java.util.List<Profile> activeProfiles)
DefaultModelBuildingResult
setEffectiveModel(Model model)
DefaultModelBuildingResult
setProblems(java.util.List<ModelProblem> problems)
DefaultModelBuildingResult
setRawModel(java.lang.String modelId, Model rawModel)
-
-
-
Field Detail
-
effectiveModel
private Model effectiveModel
-
modelIds
private java.util.List<java.lang.String> modelIds
-
rawModels
private java.util.Map<java.lang.String,Model> rawModels
-
activePomProfiles
private java.util.Map<java.lang.String,java.util.List<Profile>> activePomProfiles
-
activeExternalProfiles
private java.util.List<Profile> activeExternalProfiles
-
problems
private java.util.List<ModelProblem> problems
-
-
Method Detail
-
getEffectiveModel
public Model getEffectiveModel()
Description copied from interface:ModelBuildingResult
Gets the assembled model.- Specified by:
getEffectiveModel
in interfaceModelBuildingResult
- Returns:
- The assembled model, never
null
.
-
setEffectiveModel
public DefaultModelBuildingResult setEffectiveModel(Model model)
-
getModelIds
public java.util.List<java.lang.String> getModelIds()
Description copied from interface:ModelBuildingResult
Gets the sequence of model identifiers that denote the lineage of models from which the effective model was constructed. Model identifiers have the form<groupId>:<artifactId>:<version>
. The first identifier from the list denotes the model on which the model builder was originally invoked. The last identifier will always be an empty string that by definition denotes the super POM.- Specified by:
getModelIds
in interfaceModelBuildingResult
- Returns:
- The model identifiers from the lineage of models, never
null
.
-
addModelId
public DefaultModelBuildingResult addModelId(java.lang.String modelId)
-
getRawModel
public Model getRawModel()
Description copied from interface:ModelBuildingResult
Gets the raw model as it was read from the input model source. Apart from basic validation, the raw model has not undergone any updates by the model builder, e.g. reflects neither inheritance nor interpolation.- Specified by:
getRawModel
in interfaceModelBuildingResult
- Returns:
- The raw model, never
null
.
-
getRawModel
public Model getRawModel(java.lang.String modelId)
Description copied from interface:ModelBuildingResult
Gets the specified raw model as it was read from a model source. Apart from basic validation, a raw model has not undergone any updates by the model builder, e.g. reflects neither inheritance nor interpolation. The model identifier should be from the collection obtained byModelBuildingResult.getModelIds()
. As a special case, an empty string can be used as the identifier for the super POM.- Specified by:
getRawModel
in interfaceModelBuildingResult
- Parameters:
modelId
- The identifier of the desired raw model, must not benull
.- Returns:
- The raw model or
null
if the specified model id does not refer to a known model.
-
setRawModel
public DefaultModelBuildingResult setRawModel(java.lang.String modelId, Model rawModel)
-
getActivePomProfiles
public java.util.List<Profile> getActivePomProfiles(java.lang.String modelId)
Description copied from interface:ModelBuildingResult
Gets the profiles from the specified model that were active during model building. The model identifier should be from the collection obtained byModelBuildingResult.getModelIds()
. As a special case, an empty string can be used as the identifier for the super POM.- Specified by:
getActivePomProfiles
in interfaceModelBuildingResult
- Parameters:
modelId
- The identifier of the model whose active profiles should be retrieved, must not benull
.- Returns:
- The active profiles of the model or an empty list if none or
null
if the specified model id does not refer to a known model.
-
setActivePomProfiles
public DefaultModelBuildingResult setActivePomProfiles(java.lang.String modelId, java.util.List<Profile> activeProfiles)
-
getActiveExternalProfiles
public java.util.List<Profile> getActiveExternalProfiles()
Description copied from interface:ModelBuildingResult
Gets the external profiles that were active during model building. External profiles are those that were contributed byModelBuildingRequest.getProfiles()
.- Specified by:
getActiveExternalProfiles
in interfaceModelBuildingResult
- Returns:
- The active external profiles or an empty list if none, never
null
.
-
setActiveExternalProfiles
public DefaultModelBuildingResult setActiveExternalProfiles(java.util.List<Profile> activeProfiles)
-
getProblems
public java.util.List<ModelProblem> getProblems()
Description copied from interface:ModelBuildingResult
Gets the problems that were encountered during the model building. Note that only problems of severityModelProblem.Severity.WARNING
and below are reported here. Problems with a higher severity level cause the model builder to fail with aModelBuildingException
.- Specified by:
getProblems
in interfaceModelBuildingResult
- Returns:
- The problems that were encountered during the model building, can be empty but never
null
.
-
setProblems
public DefaultModelBuildingResult setProblems(java.util.List<ModelProblem> problems)
-
-