
io.toolisticon.aptk.compilermessage.test.OnClassAndNestedClassCompilerMessages Maven / Gradle / Ivy
package io.toolisticon.aptk.compilermessage.test;
import io.toolisticon.aptk.tools.MessagerUtils;
import io.toolisticon.aptk.tools.corematcher.ValidationMessage;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
public enum OnClassAndNestedClassCompilerMessages implements ValidationMessage{
BY_ANNOTATION("WTF_001", "Test ${0}"),
ON_CLASS("WTF_002", "ON CLASS Test ${0}"),
ON_NESTED_CLASS("WTF_004", "ON NESTED CLASS Test ${0}"),
FOR_EMPTY_CODE_TEST1("WTF_FOR_EMPTY_CODE_TEST1", "FOR_EMPTY_CODE_TEST"),
FOR_EMPTY_CODE_TEST2("WTF_FOR_EMPTY_CODE_TEST2", "FOR_EMPTY_CODE_TEST"),
ON_NESTED_CLASS_METHOD("WTF_005", "ON NESTED CLASS METHOD Test ${0}"),
ON_CLASS_METHOD("WTF_003", "ON CLASS METHOD Test ${0}"),
;
/**
* the message code.
*/
private final String code;
/**
* the message text.
*/
private final String message;
/**
* Constructor.
*
* @param code the message code
* @param message the message text
*/
OnClassAndNestedClassCompilerMessages(String code, String message) {
this.code = code;
this.message = message;
}
/**
* Gets the code of the message.
*
* @return the message code
*/
public String getCode() {
return this.code;
}
/**
* Gets the message text.
*
* @return the message text
*/
public String getMessage() {
return message;
}
// TODO: for loop over info, error, warning, mandatoryWarning
/**
* Writes an error message.
*/
public void error(Element element, Object... args) {
MessagerUtils.error(element, this, args);
}
/**
* Writes an error message.
*/
public void error(Element element, AnnotationMirror annotationMirror, Object... args) {
MessagerUtils.error(element, annotationMirror, this, args);
}
/**
* Writes an error message.
*/
public void error(Element element, AnnotationMirror annotationMirror, AnnotationValue annotationValue, Object... args) {
MessagerUtils.error(element, annotationMirror, annotationValue, this, args);
}
/**
* Writes an mandatoryWarning message.
*/
public void mandatoryWarning(Element element, Object... args) {
MessagerUtils.mandatoryWarning(element, this, args);
}
/**
* Writes an mandatoryWarning message.
*/
public void mandatoryWarning(Element element, AnnotationMirror annotationMirror, Object... args) {
MessagerUtils.mandatoryWarning(element, annotationMirror, this, args);
}
/**
* Writes an mandatoryWarning message.
*/
public void mandatoryWarning(Element element, AnnotationMirror annotationMirror, AnnotationValue annotationValue, Object... args) {
MessagerUtils.mandatoryWarning(element, annotationMirror, annotationValue, this, args);
}
/**
* Writes an warning message.
*/
public void warning(Element element, Object... args) {
MessagerUtils.warning(element, this, args);
}
/**
* Writes an warning message.
*/
public void warning(Element element, AnnotationMirror annotationMirror, Object... args) {
MessagerUtils.warning(element, annotationMirror, this, args);
}
/**
* Writes an warning message.
*/
public void warning(Element element, AnnotationMirror annotationMirror, AnnotationValue annotationValue, Object... args) {
MessagerUtils.warning(element, annotationMirror, annotationValue, this, args);
}
/**
* Writes an info message.
*/
public void info(Element element, Object... args) {
MessagerUtils.info(element, this, args);
}
/**
* Writes an info message.
*/
public void info(Element element, AnnotationMirror annotationMirror, Object... args) {
MessagerUtils.info(element, annotationMirror, this, args);
}
/**
* Writes an info message.
*/
public void info(Element element, AnnotationMirror annotationMirror, AnnotationValue annotationValue, Object... args) {
MessagerUtils.info(element, annotationMirror, annotationValue, this, args);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy