Class ProjectModel
java.lang.Object
io.codemodder.plugins.maven.operator.ProjectModel
ProjectModel represents the input parameters for the chain
-
Constructor Summary
ConstructorsConstructorDescriptionProjectModel(POMDocument pomFile, List<POMDocument> parentPomFiles, Dependency dependency, boolean skipIfNewer, boolean useProperties, Set<String> activeProfiles, boolean overrideIfAlreadyExists, QueryType queryType, File repositoryPath, String finishedByClass, boolean offline) Constructs a new ProjectModel instance with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all POM files involved in the context.booleanbooleanbooleanbooleanbooleanMap<String,List<io.codemodder.plugins.maven.operator.Pair<String, POMDocument>>> Returns a map of properties defined in various POM files based on their names.Returns a map of properties defined on the root of the given POMDocument.Returns a map of resolved properties from the POM files in the context of active profiles.voidsetActiveProfiles(Set<String> activeProfiles) voidsetDependency(Dependency dependency) voidsetFinishedByClass(String finishedByClass) voidsetModifiedByCommand(boolean modifiedByCommand) voidsetOffline(boolean offline) voidsetOverrideIfAlreadyExists(boolean overrideIfAlreadyExists) voidsetParentPomFiles(List<POMDocument> parentPomFiles) voidsetPomFile(POMDocument pomFile) voidsetQueryType(QueryType queryType) voidsetRepositoryPath(File repositoryPath) voidsetSkipIfNewer(boolean skipIfNewer) voidsetUseProperties(boolean useProperties)
-
Constructor Details
-
ProjectModel
public ProjectModel(POMDocument pomFile, List<POMDocument> parentPomFiles, Dependency dependency, boolean skipIfNewer, boolean useProperties, Set<String> activeProfiles, boolean overrideIfAlreadyExists, QueryType queryType, File repositoryPath, String finishedByClass, boolean offline) 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.offline- Whether to perform the operation in offline mode.
-
-
Method Details
-
propertiesDefinedOnPomDocument
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, propertiesDefinedByFile()POMDocument>>> 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
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
Returns a list of all POM files involved in the context.- Returns:
- A list of POMDocument instances representing all relevant POM files.
-
getPomFile
-
setPomFile
-
getParentPomFiles
-
setParentPomFiles
-
getDependency
-
setDependency
-
isSkipIfNewer
public boolean isSkipIfNewer() -
setSkipIfNewer
public void setSkipIfNewer(boolean skipIfNewer) -
isUseProperties
public boolean isUseProperties() -
setUseProperties
public void setUseProperties(boolean useProperties) -
getActiveProfiles
-
setActiveProfiles
-
isOverrideIfAlreadyExists
public boolean isOverrideIfAlreadyExists() -
setOverrideIfAlreadyExists
public void setOverrideIfAlreadyExists(boolean overrideIfAlreadyExists) -
getQueryType
-
setQueryType
-
getRepositoryPath
-
setRepositoryPath
-
getFinishedByClass
-
setFinishedByClass
-
isOffline
public boolean isOffline() -
setOffline
public void setOffline(boolean offline) -
isModifiedByCommand
public boolean isModifiedByCommand() -
setModifiedByCommand
public void setModifiedByCommand(boolean modifiedByCommand)
-