Package org.technologybrewery.baton
Class AbstractMigration
- java.lang.Object
-
- org.technologybrewery.baton.AbstractMigration
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveprotected Stringdescriptionprotected Set<String>fileNamePatternsprotected Stringname
-
Constructor Summary
Constructors Constructor Description AbstractMigration()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MigrationSummaryexecute(org.apache.maven.shared.model.fileset.FileSet[] fileSets)If active, validates applicability of the migration each targeted file and then performs the migration.StringgetDescription()Set<String>getFileNamePatterns()StringgetName()booleanisActive()protected abstract booleanperformMigration(File file)Called to perform the specific migration logic.voidsetActive(boolean active)voidsetDescription(String description)voidsetFileNamePatterns(Set<String> fileNamePatterns)voidsetName(String name)protected abstract booleanshouldExecuteOnFile(File file)Called to determine if this migration should be run on the passed file.
-
-
-
Method Detail
-
execute
public MigrationSummary execute(org.apache.maven.shared.model.fileset.FileSet[] fileSets)
If active, validates applicability of the migration each targeted file and then performs the migration. Tracks the number of files successfully and unsuccessfully changed during the process.
-
shouldExecuteOnFile
protected abstract boolean shouldExecuteOnFile(File file)
Called to determine if this migration should be run on the passed file.- Parameters:
file- file to check- Returns:
- to execute or not
-
performMigration
protected abstract boolean performMigration(File file)
Called to perform the specific migration logic.- Parameters:
file- file to migrate- Returns:
- if successful or not
-
getName
public String getName()
-
setName
public void setName(String name)
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String description)
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
-