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

smoothy.compiler.Processor Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package smoothy.compiler;

import com.google.auto.service.AutoService;

import java.util.HashSet;
import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

import smoothy.BindExtra;

@AutoService(javax.annotation.processing.Processor.class)
@SupportedSourceVersion(SourceVersion.RELEASE_7)
public class Processor extends AbstractProcessor{

    private ProcessingEnvironment mProcessingEnvironment;
    private Elements mElementsUtils;

    @Override
    public synchronized void init(ProcessingEnvironment processingEnv) {
        super.init(processingEnv);
        mProcessingEnvironment = processingEnv;
        mElementsUtils = processingEnv.getElementUtils();
    }

    @Override
    public Set getSupportedAnnotationTypes() {
        Set supportedSet = new HashSet<>();
        supportedSet.add(BindExtra.class.getCanonicalName());
        return supportedSet;
    }

    @Override
    public boolean process(Set annotations, RoundEnvironment roundEnv) {

        new SmoothyExtraProcessor(mElementsUtils).process(roundEnv, mProcessingEnvironment);

        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy