Commit 4fb987e2 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Fixed bug where annotations were not registered.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent aa19ad86
......@@ -18,14 +18,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
<annotationProcessorPaths>
<path>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>2.16</version>
</path>
</annotationProcessorPaths>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
......@@ -46,11 +40,6 @@
<artifactId>velocity-engine-core</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger</artifactId>
<version>2.16</version>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
......
package org.eclipse.ice.dev.annotations.processors;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Set;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import com.google.auto.service.AutoService;
@SupportedAnnotationTypes("org.eclipse.ice.dev.annotations.DataElement")
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@AutoService(Processor.class)
public class DataElementProcessor extends AbstractProcessor {
protected Messager messager;
@Override
public void init(ProcessingEnvironment env) {
messager = env.getMessager();
super.init(env);
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
// TODO Auto-generated method stub
for (TypeElement te : annotations)
for (Element e : roundEnv.getElementsAnnotatedWith(te))
messager.printMessage(Diagnostic.Kind.NOTE, "Printing: " + e.toString());
try {
Thread.currentThread().sleep(100000);
FileWriter writer = new FileWriter("/home/bkj/test.txt");
writer.write("Howdy!");
writer.close();
} catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
......
......@@ -18,7 +18,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>com.google.dagger</groupId>
......
......@@ -7,4 +7,5 @@ import org.eclipse.ice.dev.annotations.DataField;
@DataField(fieldName = "age", fieldType = String.class)
@DataField(fieldName = "name", fieldType = String.class)
public interface Person {
void foo();
}
......@@ -13,6 +13,7 @@ package org.eclipse.ice.tests.renderer;
import org.eclipse.ice.renderer.DataElement;
@org.eclipse.ice.dev.annotations.DataElement
public class HTMLView {
public HTMLView() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment