title |
---|
7. Annotator |
Annotator helps highlight and annotate any code based on specific rules.
In this tutorial we will annotate usages of our properties within Java code. Let's consider a literal which starts with "simple:" as a usage of our property.
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/SimpleAnnotator.java %}
<annotator language="JAVA" implementationClass="com.simpleplugin.SimpleAnnotator"/>
Let's define the following Java file and check if the IDE resolves a property.
public class Test {
public static void main(String[] args) {
System.out.println("simple:website");
}
}
If we type an undefined property name, it will annotate the code with a error.