Class ProjectModel

java.lang.Object
io.codemodder.plugins.maven.operator.ProjectModel

public class ProjectModel extends Object
ProjectModel represents the input parameters for the chain
  • Constructor Details

    • ProjectModel

      public ProjectModel(POMDocument pomFile, List<POMDocument> parentPomFiles, io.codemodder.plugins.maven.operator.Dependency dependency, boolean skipIfNewer, boolean useProperties, Set<String> activeProfiles, boolean overrideIfAlreadyExists, io.codemodder.plugins.maven.operator.QueryType queryType, Path repositoryPath, String finishedByClass)
      Constructs a new ProjectModel instance with the specified parameters.
      Parameters:
      pomFile - The POMDocument representing the main POM file.
      parentPomFiles - A list of POMDocuments representing parent POM files.
      dependency - The Dependency object to operate on.
      skipIfNewer - Whether to skip the operation if the dependency is newer.
      useProperties - Whether to use properties during the operation.
      activeProfiles - A set of active profiles to consider during property resolution.
      overrideIfAlreadyExists - Whether to override the dependency if it already exists.
      queryType - The type of query operation to perform.
      repositoryPath - The path to the repository.
      finishedByClass - The name of the class that finished the operation.
  • Method Details

    • propertiesDefinedOnPomDocument

      public static Map<String,String> propertiesDefinedOnPomDocument(POMDocument pomFile)
      Returns a map of properties defined on the root of the given POMDocument.
      Parameters:
      pomFile - The POMDocument to extract properties from.
      Returns:
      A map of property names and their values.
    • propertiesDefinedByFile

      public Map<String,List<io.codemodder.plugins.maven.operator.Pair<String,POMDocument>>> propertiesDefinedByFile()
      Returns a map of properties defined in various POM files based on their names.
      Returns:
      A map where keys are property names, and values are lists of pairs containing the property value and the corresponding POMDocument.
    • resolvedProperties

      public Map<String,String> resolvedProperties()
      Returns a map of resolved properties from the POM files in the context of active profiles.
      Returns:
      A map of property names and their resolved values.
    • allPomFiles

      public List<POMDocument> allPomFiles()
      Returns a list of all POM files involved in the context.
      Returns:
      A list of POMDocument instances representing all relevant POM files.
    • getPomFile

      public POMDocument getPomFile()
    • setPomFile

      public void setPomFile(POMDocument pomFile)
    • getParentPomFiles

      public List<POMDocument> getParentPomFiles()
    • setParentPomFiles

      public void setParentPomFiles(List<POMDocument> parentPomFiles)
    • getDependency

      public io.codemodder.plugins.maven.operator.Dependency getDependency()
    • setDependency

      public void setDependency(io.codemodder.plugins.maven.operator.Dependency dependency)
    • isSkipIfNewer

      public boolean isSkipIfNewer()
    • setSkipIfNewer

      public void setSkipIfNewer(boolean skipIfNewer)
    • isUseProperties

      public boolean isUseProperties()
    • setUseProperties

      public void setUseProperties(boolean useProperties)
    • getActiveProfiles

      public Set<String> getActiveProfiles()
    • setActiveProfiles

      public void setActiveProfiles(Set<String> activeProfiles)
    • isOverrideIfAlreadyExists

      public boolean isOverrideIfAlreadyExists()
    • setOverrideIfAlreadyExists

      public void setOverrideIfAlreadyExists(boolean overrideIfAlreadyExists)
    • getQueryType

      public io.codemodder.plugins.maven.operator.QueryType getQueryType()
    • setQueryType

      public void setQueryType(io.codemodder.plugins.maven.operator.QueryType queryType)
    • getRepositoryPath

      public Path getRepositoryPath()
    • setRepositoryPath

      public void setRepositoryPath(Path repositoryPath)
    • getFinishedByClass

      public String getFinishedByClass()
    • setFinishedByClass

      public void setFinishedByClass(String finishedByClass)
    • isModifiedByCommand

      public boolean isModifiedByCommand()
    • setModifiedByCommand

      public void setModifiedByCommand(boolean modifiedByCommand)