Package org.apache.maven.model.building
Class ModelData
- java.lang.Object
-
- org.apache.maven.model.building.ModelData
-
class ModelData extends java.lang.Object
Holds a model along with some auxiliary information. This internal utility class assists the model builder during POM processing by providing a means to transport information that cannot be (easily) extracted from the model itself.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Profile>
activeProfiles
private java.lang.String
artifactId
private java.lang.String
groupId
private Model
model
private Model
rawModel
private ModelSource
source
private java.lang.String
version
-
Constructor Summary
Constructors Constructor Description ModelData(ModelSource source, Model model)
Creates a new container for the specified model.ModelData(ModelSource source, Model model, java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
Creates a new container for the specified model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Profile>
getActiveProfiles()
Gets the active profiles from the model.java.lang.String
getArtifactId()
Gets the effective artifact identifier of the model.java.lang.String
getGroupId()
Gets the effective group identifier of the model.java.lang.String
getId()
Gets the effective identifier of the model in the form<groupId>:<artifactId>:<version>
.Model
getModel()
Gets the model being wrapped.Model
getRawModel()
Gets the raw model being wrapped.ModelSource
getSource()
java.lang.String
getVersion()
Gets the effective version of the model.void
setActiveProfiles(java.util.List<Profile> activeProfiles)
Sets the active profiles from the model.void
setArtifactId(java.lang.String artifactId)
Sets the effective artifact identifier of the model.void
setGroupId(java.lang.String groupId)
Sets the effective group identifier of the model.void
setModel(Model model)
Sets the model being wrapped.void
setRawModel(Model rawModel)
Sets the raw model being wrapped.void
setVersion(java.lang.String version)
Sets the effective version of the model.java.lang.String
toString()
-
-
-
Field Detail
-
source
private final ModelSource source
-
model
private Model model
-
rawModel
private Model rawModel
-
activeProfiles
private java.util.List<Profile> activeProfiles
-
groupId
private java.lang.String groupId
-
artifactId
private java.lang.String artifactId
-
version
private java.lang.String version
-
-
Constructor Detail
-
ModelData
ModelData(ModelSource source, Model model)
Creates a new container for the specified model.- Parameters:
model
- The model to wrap, may benull
.
-
ModelData
ModelData(ModelSource source, Model model, java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
Creates a new container for the specified model.- Parameters:
model
- The model to wrap, may benull
.groupId
- The effective group identifier of the model, may benull
.artifactId
- The effective artifact identifier of the model, may benull
.version
- The effective version of the model, may benull
.
-
-
Method Detail
-
getSource
public ModelSource getSource()
-
getModel
public Model getModel()
Gets the model being wrapped.- Returns:
- The model or
null
if not set.
-
setModel
public void setModel(Model model)
Sets the model being wrapped.- Parameters:
model
- The model, may benull
.
-
getRawModel
public Model getRawModel()
Gets the raw model being wrapped.- Returns:
- The raw model or
null
if not set.
-
setRawModel
public void setRawModel(Model rawModel)
Sets the raw model being wrapped.- Parameters:
rawModel
- The raw model, may benull
.
-
getActiveProfiles
public java.util.List<Profile> getActiveProfiles()
Gets the active profiles from the model.- Returns:
- The active profiles or
null
if not set.
-
setActiveProfiles
public void setActiveProfiles(java.util.List<Profile> activeProfiles)
Sets the active profiles from the model.- Parameters:
activeProfiles
- The active profiles, may benull
.
-
getGroupId
public java.lang.String getGroupId()
Gets the effective group identifier of the model.- Returns:
- The effective group identifier of the model or an empty string if unknown, never
null
.
-
setGroupId
public void setGroupId(java.lang.String groupId)
Sets the effective group identifier of the model.- Parameters:
groupId
- The effective group identifier of the model, may benull
.
-
getArtifactId
public java.lang.String getArtifactId()
Gets the effective artifact identifier of the model.- Returns:
- The effective artifact identifier of the model or an empty string if unknown, never
null
.
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Sets the effective artifact identifier of the model.- Parameters:
artifactId
- The effective artifact identifier of the model, may benull
.
-
getVersion
public java.lang.String getVersion()
Gets the effective version of the model.- Returns:
- The effective version of the model or an empty string if unknown, never
null
.
-
setVersion
public void setVersion(java.lang.String version)
Sets the effective version of the model.- Parameters:
version
- The effective version of the model, may benull
.
-
getId
public java.lang.String getId()
Gets the effective identifier of the model in the form<groupId>:<artifactId>:<version>
.- Returns:
- The effective identifier of the model, never
null
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-