All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codemodder.RawFileCodemodRunner Maven / Gradle / Ivy

There is a newer version: 0.97.9
Show newest version
package io.codemodder;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Objects;

/**
 * {@inheritDoc}
 *
 * 

This type specializes in non-Java file. */ final class RawFileCodemodRunner implements CodemodRunner { private final RawFileChanger changer; private final IncludesExcludes rootedFileMatcher; RawFileCodemodRunner(final RawFileChanger changer, final Path projectDir) { this.changer = Objects.requireNonNull(changer); this.rootedFileMatcher = changer.getIncludesExcludesPattern().getRootedMatcher(projectDir); } RawFileCodemodRunner( final RawFileChanger changer, final IncludesExcludes globalIncludesExcludes) { this.changer = Objects.requireNonNull(changer); this.rootedFileMatcher = Objects.requireNonNull(globalIncludesExcludes); } @Override public boolean supports(final Path path) { return rootedFileMatcher.shouldInspect(path.toFile()) && changer.supports(path); } @Override public CodemodFileScanningResult run(final CodemodInvocationContext context) throws IOException { return changer.visitFile(context); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy