Java 8 RoundEnvironment - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RoundEnvironment class.

This code example shows how to use the following methods:getElementsAnnotatedWith, processingOver
    } 
 
    @Override 
    public boolean process(Set<? extends TypeElement> typeElements, RoundEnvironment roundEnvironment) {
 
        parcelProcessor.submit(ParcelClass.class, reloadableASTElementFactory.buildProviders(roundEnvironment.getElementsAnnotatedWith(ParcelClass.class)));
        parcelProcessor.submit(ParcelClasses.class, reloadableASTElementFactory.buildProviders(roundEnvironment.getElementsAnnotatedWith(ParcelClasses.class)));
        parcelProcessor.submit(Parcel.class, reloadableASTElementFactory.buildProviders(roundEnvironment.getElementsAnnotatedWith(Parcel.class)));
 
        parcelProcessor.execute();
 
        if (roundEnvironment.processingOver()) {
            // Throws an exception if errors still exist. 
            parcelProcessor.checkForErrors();
        } 
 
        return true; 
    } 
 
    @Override 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getElementsAnnotatedWith, getRootElements
            throw new AssertionError(msg);
        } 
 
        @Override 
        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
            if (roundEnv.getRootElements().size() == 0) {
                return true; 
            } 
            if (annotations.isEmpty() || annotations.size() > 1) {
                error("no anno found/wrong number of annotations found: " + annotations.size());
            } 
            TypeElement anno = (TypeElement)annotations.toArray()[0];
            Set<? extends Element> annoElems = roundEnv.getElementsAnnotatedWith(anno);
            if (annoElems.isEmpty() || annoElems.size() > 1) {
                error("no annotated element found/wrong number of annotated elements found: " + annoElems.size());
            } 
            Element annoElement = (Element)annoElems.toArray()[0];
            if (!(annoElement instanceof ExecutableElement)) {
                error("annotated element must be a method"); 
            } 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:errorRaised, processingOver
    /** public for ServiceLoader */ 
    public ServiceProviderProcessor() {} 
 
    @Override 
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
        if (roundEnv.errorRaised()) {
            return false; 
        } 
        if (roundEnv.processingOver()) {
            writeServices(); 
            return true; 
        } else { 
            return true; 
        } 
 
    } 
 
    private void writeServices() { 
        try { 
            FileObject out = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/one",new Element[0]);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
import static javax.tools.Diagnostic.Kind.*;
 
public class T6365040 extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from T6365040");
        return true; 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
 * First of several processors to run. 
 */ 
public class ProcFoo extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from ProcFoo");
        return false; 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
 * Second of several processors to run. 
 */ 
public class ProcBar extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from ProcBar");
        return false; 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
import static javax.tools.Diagnostic.Kind.*;
 
public class T6365040 extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from T6365040");
        return true; 
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
@SupportedAnnotationTypes("*") 
public class JSR269Processor extends AbstractProcessor {
 
	@Override 
	public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
		if (!roundEnv.processingOver()) {
 
			final Filer filer = processingEnv.getFiler();
			try { 
				final JavaFileObject sourceFile = filer.createSourceFile("tycho590.processed.Processor");
				Writer sourceWriter = sourceFile.openWriter();
				sourceWriter.append("package tycho590.processed;");
				sourceWriter.append(String.format("%n"));
				sourceWriter.append("public class Processor {}");
				sourceWriter.close();				
			} catch (IOException ex) {
				//That will happen on round 2 because source file already exists 
				System.out.println("[APT] " + ex.getMessage());				
			} 
		} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
 * First of several processors to run. 
 */ 
public class ProcFoo extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from ProcFoo");
        return false; 
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:processingOver
 * Second of several processors to run. 
 */ 
public class ProcBar extends JavacTestingAbstractProcessor { 
    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        if (!roundEnvironment.processingOver())
            messager.printMessage(NOTE, "Hello from ProcBar");
        return false; 
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 RoundEnvironment Methods: