Class 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.
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

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

      • 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 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 be null.
      • 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 be null.
      • 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 be null.
      • 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 be null.
      • 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 class java.lang.Object