Package org.apache.maven.model.building
Class ModelData
- java.lang.Object
-
- org.apache.maven.model.building.ModelData
-
class ModelData extends java.lang.ObjectHolds 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>activeProfilesprivate java.lang.StringartifactIdprivate java.lang.StringgroupIdprivate Modelmodelprivate ModelrawModelprivate ModelSourcesourceprivate java.lang.Stringversion
-
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.StringgetArtifactId()Gets the effective artifact identifier of the model.java.lang.StringgetGroupId()Gets the effective group identifier of the model.java.lang.StringgetId()Gets the effective identifier of the model in the form<groupId>:<artifactId>:<version>.ModelgetModel()Gets the model being wrapped.ModelgetRawModel()Gets the raw model being wrapped.ModelSourcegetSource()java.lang.StringgetVersion()Gets the effective version of the model.voidsetActiveProfiles(java.util.List<Profile> activeProfiles)Sets the active profiles from the model.voidsetArtifactId(java.lang.String artifactId)Sets the effective artifact identifier of the model.voidsetGroupId(java.lang.String groupId)Sets the effective group identifier of the model.voidsetModel(Model model)Sets the model being wrapped.voidsetRawModel(Model rawModel)Sets the raw model being wrapped.voidsetVersion(java.lang.String version)Sets the effective version of the model.java.lang.StringtoString()
-
-
-
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
nullif 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
nullif 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
nullif 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:
toStringin classjava.lang.Object
-
-