
lombok.eclipse.handlers.HandleArtemisSystem Maven / Gradle / Ivy
The newest version!
package lombok.eclipse.handlers;
import static lombok.core.util.ErrorMessages.canBeUsedOnClassOnly;
import static lombok.eclipse.handlers.EclipseUtil.filterInvalid;
import java.util.List;
import lombok.ArtemisSystem;
import lombok.ListenerSupport;
import lombok.core.AnnotationValues;
import lombok.eclipse.DeferUntilBuildFieldsAndMethods;
import lombok.eclipse.EclipseAnnotationHandler;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.handlers.ast.EclipseType;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.kohsuke.MetaInfServices;
/**
* Handles the {@link ListenerSupport} annotation for eclipse using the {@link PatchListenerSupport}.
*/
@DeferUntilBuildFieldsAndMethods
@MetaInfServices(EclipseAnnotationHandler.class)
public class HandleArtemisSystem extends EclipseAnnotationHandler
{
@Override
public void handle(final AnnotationValues annotation, final Annotation source, final EclipseNode annotationNode) {
EclipseType type = EclipseType.typeOf(annotationNode, source);
if (type.isAnnotation() || type.isInterface()) {
annotationNode.addError(canBeUsedOnClassOnly(ArtemisSystem.class));
return;
}
for (lombok.ast.Annotation a : type.annotations())
{
// because all else is null...
if (a.toString().startsWith("@WovenByTheHuntress"))
return;
}
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy