Class ModelData

java.lang.Object
org.apache.maven.model.building.ModelData

class ModelData extends 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 Details

    • source

      private final ModelSource source
    • model

      private Model model
    • rawModel

      private Model rawModel
    • activeProfiles

      private List<Profile> activeProfiles
    • groupId

      private String groupId
    • artifactId

      private String artifactId
    • version

      private String version
  • Constructor Details

    • ModelData

      ModelData(ModelSource source, Model model)
      Creates a new container for the specified model.
      Parameters:
      model - The model to wrap, may be null.
    • ModelData

      ModelData(ModelSource source, Model model, String groupId, String artifactId, String version)
      Creates a new container for the specified model.
      Parameters:
      model - The model to wrap, may be null.
      groupId - The effective group identifier of the model, may be null.
      artifactId - The effective artifact identifier of the model, may be null.
      version - The effective version of the model, may be null.
  • Method Details

    • 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 be null.
    • 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 be null.
    • getActiveProfiles

      public List<Profile> getActiveProfiles()
      Gets the active profiles from the model.
      Returns:
      The active profiles or null if not set.
    • setActiveProfiles

      public void setActiveProfiles(List<Profile> activeProfiles)
      Sets the active profiles from the model.
      Parameters:
      activeProfiles - The active profiles, may be null.
    • getGroupId

      public 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(String groupId)
      Sets the effective group identifier of the model.
      Parameters:
      groupId - The effective group identifier of the model, may be null.
    • getArtifactId

      public 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(String artifactId)
      Sets the effective artifact identifier of the model.
      Parameters:
      artifactId - The effective artifact identifier of the model, may be null.
    • getVersion

      public 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(String version)
      Sets the effective version of the model.
      Parameters:
      version - The effective version of the model, may be null.
    • getId

      public 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 String toString()
      Overrides:
      toString in class Object