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

tech.harmonysoft.oss.traute.javac.instrumentation.AbstractInstrumentator Maven / Gradle / Ivy

There is a newer version: 1.1.10
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy