Class AbstractMigration

  • All Implemented Interfaces:
    Migration

    public abstract class AbstractMigration
    extends Object
    implements Migration
    Common migration logic to make it easier to implement custom migrations.
    • Field Detail

      • description

        protected String description
      • active

        protected boolean active
      • fileNamePatterns

        protected Set<String> fileNamePatterns
    • Constructor Detail

      • AbstractMigration

        public AbstractMigration()
    • 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.
        Specified by:
        execute in interface Migration
        Parameters:
        fileSets - the file sets to process with this migration
        Returns:
        a summary of results
      • 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)
      • getFileNamePatterns

        public Set<String> getFileNamePatterns()
      • setFileNamePatterns

        public void setFileNamePatterns​(Set<String> fileNamePatterns)