tech.harmonysoft.oss.traute.javac.instrumentation.AbstractInstrumentator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of traute-javac Show documentation
Show all versions of traute-javac Show documentation
A Javac plugin which inserts null-checks into generated bytecode
package tech.harmonysoft.oss.traute.javac.instrumentation;
import org.jetbrains.annotations.NotNull;
/**
* A utility {@link Instrumentator} base class which provides logic common for all implementations
*
* @param target instrumentation info
*/
public abstract class AbstractInstrumentator implements Instrumentator {
@Override
public void instrument(@NotNull T instrumentationInfo) {
boolean instrumented = mayBeInstrument(instrumentationInfo);
if (instrumented) {
instrumentationInfo.getContext().getStatsCollector().increment(instrumentationInfo.getType());
}
}
protected abstract boolean mayBeInstrument(@NotNull T instrumentationInfo);
}